diff --git a/hmip_cli.py b/hmip_cli.py index a76ae410..09c97afd 100644 --- a/hmip_cli.py +++ b/hmip_cli.py @@ -811,9 +811,7 @@ def main(): for p in group.profiles: isActive = p.id == group.activeProfile.id print( - "Index: {} - Id: {} - Name: {} - Active: {}".format( - p.index, p.id, p.name, isActive - ) + f"Index: {p.index} - Id: {p.id} - Name: {p.name} - Active: {isActive} (Enabled: {p.enabled}, Visible: {p.visible})" ) if args.group_shutter_level: diff --git a/homematicip/base/enums.py b/homematicip/base/enums.py index b9d1ba68..12d799ba 100644 --- a/homematicip/base/enums.py +++ b/homematicip/base/enums.py @@ -358,6 +358,7 @@ class AutomationRuleType(AutoNameEnum): class FunctionalHomeType(AutoNameEnum): ACCESS_CONTROL = auto() INDOOR_CLIMATE = auto() + ENERGY = auto() LIGHT_AND_SHADOW = auto() SECURITY_AND_ALARM = auto() WEATHER_AND_ENVIRONMENT = auto() diff --git a/homematicip/base/functionalChannels.py b/homematicip/base/functionalChannels.py index 176893ec..c13de439 100644 --- a/homematicip/base/functionalChannels.py +++ b/homematicip/base/functionalChannels.py @@ -353,7 +353,7 @@ def set_slats_level(self, slatsLevel=0.0, shutterLevel=None): """ if shutterLevel is None: shutterLevel = self.shutterLevel - + data = { "channelIndex": self.index, "deviceId": self.device.id, @@ -1265,12 +1265,14 @@ def __init__(self, device, connection): self.dutyCycleLevel = 0.0 self.accessPointPriority = 0 self.signalBrightness = 0 + self.filteredMulticastRoutingEnabled = None def from_json(self, js, groups: Iterable[Group]): super().from_json(js, groups) self.set_attr_from_dict("dutyCycleLevel", js) self.set_attr_from_dict("accessPointPriority", js) self.set_attr_from_dict("signalBrightness", js) + self.set_attr_from_dict("filteredMulticastRoutingEnabled", js) class DeviceSabotageChannel(DeviceBaseChannel): diff --git a/homematicip/class_maps.py b/homematicip/class_maps.py index 041b0f37..1fb12626 100644 --- a/homematicip/class_maps.py +++ b/homematicip/class_maps.py @@ -163,6 +163,7 @@ TYPE_FUNCTIONALHOME_MAP = { FunctionalHomeType.INDOOR_CLIMATE: IndoorClimateHome, + FunctionalHomeType.ENERGY: EnergyHome, FunctionalHomeType.LIGHT_AND_SHADOW: LightAndShadowHome, FunctionalHomeType.SECURITY_AND_ALARM: SecurityAndAlarmHome, FunctionalHomeType.WEATHER_AND_ENVIRONMENT: WeatherAndEnvironmentHome, diff --git a/homematicip/device.py b/homematicip/device.py index 86e8d3a0..01467228 100644 --- a/homematicip/device.py +++ b/homematicip/device.py @@ -128,6 +128,7 @@ class Device(BaseDevice): "IOptionalFeatureDisplayContrast": [], "IOptionalFeatureMountingOrientation": ["mountingOrientation"], "IOptionalFeatureControlsMountingOrientation": ["controlsMountingOrientation"], + "IOptionalFeatureFilteredMulticastRouter": ["filteredMulticastRoutingEnabled"], } def __init__(self, connection): diff --git a/homematicip/functionalHomes.py b/homematicip/functionalHomes.py index a1bd6976..ba151c8f 100644 --- a/homematicip/functionalHomes.py +++ b/homematicip/functionalHomes.py @@ -62,6 +62,10 @@ def from_json(self, js, groups: List[Group]): ) +class EnergyHome(FunctionalHome): + pass + + class WeatherAndEnvironmentHome(FunctionalHome): pass diff --git a/homematicip_demo/json_data/home.json b/homematicip_demo/json_data/home.json index 1ee4dc70..9cd7f006 100644 --- a/homematicip_demo/json_data/home.json +++ b/homematicip_demo/json_data/home.json @@ -417,6 +417,7 @@ "deviceUndervoltage": false, "dutyCycle": false, "dutyCycleLevel": 8.0, + "filteredMulticastRoutingEnabled": true, "functionalChannelType": "ACCESS_CONTROLLER_CHANNEL", "groupIndex": 0, "groups": [], @@ -488,6 +489,7 @@ "deviceUndervoltage": false, "dutyCycle": false, "dutyCycleLevel": 8.0, + "filteredMulticastRoutingEnabled": true, "functionalChannelType": "ACCESS_CONTROLLER_CHANNEL", "groupIndex": 0, "groups": [], @@ -10758,125 +10760,123 @@ "updateState": "UP_TO_DATE" }, "3014F7110000000000ETRVCL": { - "automaticValveAdaptionNeeded": false, - "availableFirmwareVersion": "1.0.14", - "connectionType": "HMIP_RF", - "deviceArchetype": "HMIP", - "firmwareVersion": "1.0.14", - "firmwareVersionInteger": 65550, - "functionalChannels": { - "0": { - "busConfigMismatch": null, - "coProFaulty": false, - "coProRestartNeeded": false, - "coProUpdateFailure": null, - "configPending": false, - "controlsMountingOrientation": null, - "daliBusState": null, - "defaultLinkedGroup": [], - "deviceCommunicationError": null, - "deviceDriveError": null, - "deviceDriveModeError": null, - "deviceId": "3014F7110000000000ETRVCL", - "deviceOperationMode": null, - "deviceOverheated": false, - "deviceOverloaded": false, - "devicePowerFailureDetected": false, - "deviceUndervoltage": false, - "displayContrast": null, - "dutyCycle": false, - "functionalChannelType": "DEVICE_OPERATIONLOCK_WITH_SABOTAGE", - "groupIndex": 0, - "groups": [ - "00000000-0000-0000-0000-000000000018" - ], - "index": 0, - "label": "", - "lockJammed": null, - "lowBat": false, - "mountingOrientation": null, - "multicastRoutingEnabled": false, - "operationLockActive": false, - "particulateMatterSensorCommunicationError": null, - "particulateMatterSensorError": null, - "powerShortCircuit": null, - "profilePeriodLimitReached": null, - "routerModuleEnabled": false, - "routerModuleSupported": false, - "rssiDeviceValue": -52, - "rssiPeerValue": -53, - "sabotage": null, - "shortCircuitDataLine": null, - "supportedOptionalFeatures": { - "IFeatureBusConfigMismatch": false, - "IFeatureDeviceCoProError": false, - "IFeatureDeviceCoProRestart": false, - "IFeatureDeviceCoProUpdate": true, - "IFeatureDeviceCommunicationError": false, - "IFeatureDeviceDaliBusError": false, - "IFeatureDeviceDriveError": false, - "IFeatureDeviceDriveModeError": false, - "IFeatureDeviceIdentify": false, - "IFeatureDeviceOverheated": false, - "IFeatureDeviceOverloaded": false, - "IFeatureDeviceParticulateMatterSensorCommunicationError": false, - "IFeatureDeviceParticulateMatterSensorError": false, - "IFeatureDevicePowerFailure": false, - "IFeatureDeviceTemperatureHumiditySensorCommunicationError": false, - "IFeatureDeviceTemperatureHumiditySensorError": false, - "IFeatureDeviceTemperatureOutOfRange": false, - "IFeatureDeviceUndervoltage": false, - "IFeatureMulticastRouter": false, - "IFeaturePowerShortCircuit": false, - "IFeatureProfilePeriodLimit": false, - "IFeatureRssiValue": true, - "IFeatureShortCircuitDataLine": false, - "IOptionalFeatureDefaultLinkedGroup": false, - "IOptionalFeatureDeviceErrorLockJammed": false, - "IOptionalFeatureDeviceOperationMode": false, - "IOptionalFeatureDisplayContrast": false, - "IOptionalFeatureDutyCycle": true, - "IOptionalFeatureLowBat": true, - "IOptionalFeatureMountingOrientation": false - }, - "temperatureHumiditySensorCommunicationError": null, - "temperatureHumiditySensorError": null, - "temperatureOutOfRange": false, - "unreach": false - }, - "1": { - "channelRole": "HEATING_CONTROLLER", - "deviceId": "3014F7110000000000ETRVCL", - "functionalChannelType": "HEATING_THERMOSTAT_CHANNEL", - "groupIndex": 1, - "groups": [ - "00000000-0000-0000-0000-000000000019", - "00000000-0000-0000-0000-000000000021" - ], - "index": 1, - "label": "", - "setPointTemperature": 16.0, - "temperatureOffset": 0.0, - "valveActualTemperature": 24.9, - "valvePosition": 0.0, - "valveState": "ADAPTION_DONE" - } + "automaticValveAdaptionNeeded": false, + "availableFirmwareVersion": "1.0.14", + "connectionType": "HMIP_RF", + "deviceArchetype": "HMIP", + "firmwareVersion": "1.0.14", + "firmwareVersionInteger": 65550, + "functionalChannels": { + "0": { + "busConfigMismatch": null, + "coProFaulty": false, + "coProRestartNeeded": false, + "coProUpdateFailure": null, + "configPending": false, + "controlsMountingOrientation": null, + "daliBusState": null, + "defaultLinkedGroup": [], + "deviceCommunicationError": null, + "deviceDriveError": null, + "deviceDriveModeError": null, + "deviceId": "3014F7110000000000ETRVCL", + "deviceOperationMode": null, + "deviceOverheated": false, + "deviceOverloaded": false, + "devicePowerFailureDetected": false, + "deviceUndervoltage": false, + "displayContrast": null, + "dutyCycle": false, + "functionalChannelType": "DEVICE_OPERATIONLOCK_WITH_SABOTAGE", + "groupIndex": 0, + "groups": ["00000000-0000-0000-0000-000000000018"], + "index": 0, + "label": "", + "lockJammed": null, + "lowBat": false, + "mountingOrientation": null, + "multicastRoutingEnabled": false, + "operationLockActive": false, + "particulateMatterSensorCommunicationError": null, + "particulateMatterSensorError": null, + "powerShortCircuit": null, + "profilePeriodLimitReached": null, + "routerModuleEnabled": false, + "routerModuleSupported": false, + "rssiDeviceValue": -52, + "rssiPeerValue": -53, + "sabotage": null, + "shortCircuitDataLine": null, + "supportedOptionalFeatures": { + "IFeatureBusConfigMismatch": false, + "IFeatureDeviceCoProError": false, + "IFeatureDeviceCoProRestart": false, + "IFeatureDeviceCoProUpdate": true, + "IFeatureDeviceCommunicationError": false, + "IFeatureDeviceDaliBusError": false, + "IFeatureDeviceDriveError": false, + "IFeatureDeviceDriveModeError": false, + "IFeatureDeviceIdentify": false, + "IFeatureDeviceOverheated": false, + "IFeatureDeviceOverloaded": false, + "IFeatureDeviceParticulateMatterSensorCommunicationError": false, + "IFeatureDeviceParticulateMatterSensorError": false, + "IFeatureDevicePowerFailure": false, + "IFeatureDeviceTemperatureHumiditySensorCommunicationError": false, + "IFeatureDeviceTemperatureHumiditySensorError": false, + "IFeatureDeviceTemperatureOutOfRange": false, + "IFeatureDeviceUndervoltage": false, + "IFeatureMulticastRouter": false, + "IFeaturePowerShortCircuit": false, + "IFeatureProfilePeriodLimit": false, + "IFeatureRssiValue": true, + "IFeatureShortCircuitDataLine": false, + "IOptionalFeatureDefaultLinkedGroup": false, + "IOptionalFeatureDeviceErrorLockJammed": false, + "IOptionalFeatureDeviceOperationMode": false, + "IOptionalFeatureDisplayContrast": false, + "IOptionalFeatureDutyCycle": true, + "IOptionalFeatureLowBat": true, + "IOptionalFeatureMountingOrientation": false + }, + "temperatureHumiditySensorCommunicationError": null, + "temperatureHumiditySensorError": null, + "temperatureOutOfRange": false, + "unreach": false }, - "homeId": "00000000-0000-0000-0000-000000000001", - "id": "3014F7110000000000ETRVCL", - "label": "Heizk\u00f6rperthermostat Schlafzimmer", - "lastStatusUpdate": 1687826867079, - "liveUpdateState": "LIVE_UPDATE_NOT_SUPPORTED", - "manuallyUpdateForced": false, - "manufacturerCode": 1, - "measuredAttributes": {}, - "modelId": 469, - "modelType": "HmIP-eTRV-CL", - "oem": "eQ-3", - "permanentlyReachable": true, - "serializedGlobalTradeItemNumber": "3014F7110000000000ETRVCL", - "type": "HEATING_THERMOSTAT_COMPACT_PLUS", - "updateState": "UP_TO_DATE" + "1": { + "channelRole": "HEATING_CONTROLLER", + "deviceId": "3014F7110000000000ETRVCL", + "functionalChannelType": "HEATING_THERMOSTAT_CHANNEL", + "groupIndex": 1, + "groups": [ + "00000000-0000-0000-0000-000000000019", + "00000000-0000-0000-0000-000000000021" + ], + "index": 1, + "label": "", + "setPointTemperature": 16.0, + "temperatureOffset": 0.0, + "valveActualTemperature": 24.9, + "valvePosition": 0.0, + "valveState": "ADAPTION_DONE" + } + }, + "homeId": "00000000-0000-0000-0000-000000000001", + "id": "3014F7110000000000ETRVCL", + "label": "Heizk\u00f6rperthermostat Schlafzimmer", + "lastStatusUpdate": 1687826867079, + "liveUpdateState": "LIVE_UPDATE_NOT_SUPPORTED", + "manuallyUpdateForced": false, + "manufacturerCode": 1, + "measuredAttributes": {}, + "modelId": 469, + "modelType": "HmIP-eTRV-CL", + "oem": "eQ-3", + "permanentlyReachable": true, + "serializedGlobalTradeItemNumber": "3014F7110000000000ETRVCL", + "type": "HEATING_THERMOSTAT_COMPACT_PLUS", + "updateState": "UP_TO_DATE" }, "3014F7110000000000DSDPCB": { "availableFirmwareVersion": "1.0.6", @@ -12857,6 +12857,11 @@ "optimumStartStopEnabled": false, "solution": "INDOOR_CLIMATE" }, + "ENERGY": { + "active": false, + "functionalGroups": [], + "solution": "ENERGY" + }, "LIGHT_AND_SHADOW": { "active": true, "extendedLinkedShutterGroups": [], diff --git a/tests/test_functional_channels.py b/tests/test_functional_channels.py index 5915f4ea..9eb45ec7 100644 --- a/tests/test_functional_channels.py +++ b/tests/test_functional_channels.py @@ -16,6 +16,13 @@ from homematicip.class_maps import TYPE_FUNCTIONALCHANNEL_MAP +def test_access_controller_channel(fake_home: Home): + with no_ssl_verification(): + ch = fake_home.search_channel("3014F711A000000BAD0CAAAA", 0) + assert isinstance(ch, AccessControllerChannel) + assert ch.filteredMulticastRoutingEnabled == True + + def test_acceleration_sensor_channel(fake_home: Home): with no_ssl_verification(): ch = fake_home.search_channel("3014F7110000000000000031", 1) @@ -117,17 +124,17 @@ def test_device_base_floor_heating_channel(fake_home: Home): def test_device_operation_lock_channel(fake_home: Home): with no_ssl_verification(): - ch = fake_home.search_channel("3014F7110000000000000015",0) + ch = fake_home.search_channel("3014F7110000000000000015", 0) assert isinstance(ch, DeviceOperationLockChannel) ch.set_operation_lock(False) fake_home.get_current_state() - ch = fake_home.search_channel("3014F7110000000000000015",0) + ch = fake_home.search_channel("3014F7110000000000000015", 0) assert ch.operationLockActive is False - + ch.set_operation_lock(True) fake_home.get_current_state() - ch = fake_home.search_channel("3014F7110000000000000015",0) + ch = fake_home.search_channel("3014F7110000000000000015", 0) assert ch.operationLockActive is True