From 2bf049d36b52418d26a0f8fa366a579fe8a8b25f Mon Sep 17 00:00:00 2001 From: Daniel Perna Date: Wed, 4 Dec 2019 21:53:07 +0100 Subject: [PATCH] 0.1.62 (#272) * Bump version * Remove LOWBAT for WeatherSensor-class, refs #230 * Remove LOWBAT for HM-Sec-SD, refs #230 * Add battery reporting to HMIP-WRC2 (#265) * Add output support to HMW-IO-12-FM (#269) * Update class IPThermostatWall230V (#271) * Update IPThermostatWall230V class Used class `IPThermostatWall2` as template for `IPThermostatWall230V`. Removed `OPERATING_VOLTAGE`, `LOW_BAT` and `HelperLowBatIP`. * Cleanup * Update changelog --- changelog.txt | 6 ++++++ pyhomematic/devicetypes/actors.py | 11 ++++++++++ pyhomematic/devicetypes/misc.py | 7 ++---- pyhomematic/devicetypes/sensors.py | 4 ++++ pyhomematic/devicetypes/thermostats.py | 30 ++++++++++++++++++++++---- setup.py | 2 +- 6 files changed, 50 insertions(+), 10 deletions(-) diff --git a/changelog.txt b/changelog.txt index f929852f9..f7282d736 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,9 @@ +Version 0.1.62 (2019-12-04) +- Remove `LOWBAT` for some devices (#230) @danielperna84 +- Add battery reporting for `HMIP-WRC2` @pg5 +- Add output-support for `HMW-IO-12-FM` (#269) @Lokla +- Add action-nodes for `HmIP-BWTH`, `HmIP-BWTH24` (#270) @dickesW + Version 0.1.61 (2019-10-13) - Fix device storage @danielperna84 - Add battery attribute for BC-PB-2-WM @danielperna84 diff --git a/pyhomematic/devicetypes/actors.py b/pyhomematic/devicetypes/actors.py index a61008f99..c97ae14f4 100644 --- a/pyhomematic/devicetypes/actors.py +++ b/pyhomematic/devicetypes/actors.py @@ -214,10 +214,20 @@ class IOSwitch(GenericSwitch, HelperWorking, HelperEventRemote, HelperWired): Switch turning attached device on or off. """ + def __init__(self, device_description, proxy, resolveparamsets=False): + self._doc = [] + super().__init__(device_description, proxy, resolveparamsets) + if "HMW-IO-12-FM" in self.TYPE: + for chan in range(1, 13): + if self._proxy.getParamset("%s:%i" % (self._ADDRESS, chan), "MASTER").get("BEHAVIOUR", None) == 1: + self._doc.append(chan) + @property def ELEMENT(self): if "HMW-IO-12-Sw7-DR" in self.TYPE: return [13, 14, 15, 16, 17, 18, 19] + if "HMW-IO-12-FM" in self.TYPE: + return self._doc if "HMW-LC-Sw2-DR" in self.TYPE: return [3, 4] return [1] @@ -790,6 +800,7 @@ def turn_off_effect(self): "HM-ES-PMSwX": SwitchPowermeter, "HMW-IO-12-Sw7-DR": IOSwitch, "HMW-IO-12-Sw14-DR": HMWIOSwitch, + "HMW-IO-12-FM": IOSwitch, "HMW-LC-Sw2-DR": IOSwitch, "HMW-LC-Bl1-DR": KeyBlind, "HMW-LC-Bl1-DR-2": KeyBlind, diff --git a/pyhomematic/devicetypes/misc.py b/pyhomematic/devicetypes/misc.py index 07370bbec..1cc38775d 100644 --- a/pyhomematic/devicetypes/misc.py +++ b/pyhomematic/devicetypes/misc.py @@ -54,8 +54,6 @@ def ELEMENT(self): return list(range(1, 20)) if "HMW-IO-4-FM" in self.TYPE: return [1, 2, 3, 4] - if "HMW-IO-12-FM" in self.TYPE: - return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] if "HmIP-RC8" in self.TYPE: return [1, 2, 3, 4, 5, 6, 7, 8] return [1] @@ -136,9 +134,8 @@ def ELEMENT(self): "HM-PB-4Dis-WM": Remote, "HM-PB-4Dis-WM-2": Remote, "HMW-IO-4-FM": Remote, - "HMW-IO-12-FM": Remote, - "HMIP-WRC2": Remote, - "HmIP-WRC2": Remote, + "HMIP-WRC2": RemoteBatteryIP, + "HmIP-WRC2": RemoteBatteryIP, "HmIP-BRC2": Remote, "HmIP-WRC6": RemoteBatteryIP, "HmIP-KRCA": Remote, diff --git a/pyhomematic/devicetypes/sensors.py b/pyhomematic/devicetypes/sensors.py index 187e496eb..9d54419f7 100644 --- a/pyhomematic/devicetypes/sensors.py +++ b/pyhomematic/devicetypes/sensors.py @@ -209,6 +209,9 @@ def get_power(self, channel=None): class Smoke(SensorHm, HelperBinaryState): """Smoke alarm. This is a binary sensor.""" + def __init__(self, device_description, proxy, resolveparamsets=False): + super().__init__(device_description, proxy, resolveparamsets) + del self.ATTRIBUTENODE["LOWBAT"] def is_smoke(self, channel=None): """ Return True if smoke is detected """ @@ -593,6 +596,7 @@ def __init__(self, device_description, proxy, resolveparamsets=False): "SUNSHINEDURATION": self.ELEMENT, "BRIGHTNESS": self.ELEMENT}) self.BINARYNODE.update({"RAINING": self.ELEMENT}) + del self.ATTRIBUTENODE["LOWBAT"] def get_temperature(self, channel=None): return float(self.getSensorData("TEMPERATURE", channel)) diff --git a/pyhomematic/devicetypes/thermostats.py b/pyhomematic/devicetypes/thermostats.py index 9d24f654a..95d7c6331 100644 --- a/pyhomematic/devicetypes/thermostats.py +++ b/pyhomematic/devicetypes/thermostats.py @@ -305,9 +305,9 @@ def turnoff(self): """ Turn off Thermostat. """ self.writeNodeData("SET_POINT_TEMPERATURE", self.OFF_VALUE) -class IPThermostatWall230V(HMThermostat): +class IPThermostatWall230V(HMThermostat, IPAreaThermostat): """ - HmIP-BWTH + HmIP-BWTH, HmIP-BWTH24 ClimateControl-Wall Thermostat that measures temperature and allows to set a target temperature or use some automatic mode. """ def __init__(self, device_description, proxy, resolveparamsets=False): @@ -317,8 +317,12 @@ def __init__(self, device_description, proxy, resolveparamsets=False): self.SENSORNODE.update({"ACTUAL_TEMPERATURE": [1], "HUMIDITY": [1]}) self.WRITENODE.update({"SET_POINT_TEMPERATURE": [1]}) - self.ACTIONNODE.update({"BOOST_MODE": [1]}) - self.ATTRIBUTENODE.update({"SET_POINT_MODE": [1]}) + self.ACTIONNODE.update({"AUTO_MODE": [1], + "MANU_MODE": [1], + "CONTROL_MODE": [1], + "BOOST_MODE": [1]}) + self.ATTRIBUTENODE.update({"SET_POINT_MODE": [1], + "BOOST_MODE": [1]}) def get_set_temperature(self): """ Returns the current target temperature. """ @@ -333,6 +337,24 @@ def set_temperature(self, target_temperature): return False self.writeNodeData("SET_POINT_TEMPERATURE", target_temperature) + @property + def MODE(self): + """ Return mode. """ + if self.getAttributeData("BOOST_MODE"): + return self.BOOST_MODE + else: + return self.getAttributeData("SET_POINT_MODE") + + @MODE.setter + def MODE(self, setmode): + """ Set mode. """ + if setmode == self.BOOST_MODE: + self.actionNodeData('BOOST_MODE', True) + elif setmode in [self.AUTO_MODE, self.MANU_MODE]: + if self.getAttributeData("BOOST_MODE"): + self.actionNodeData('BOOST_MODE', False) + self.actionNodeData('CONTROL_MODE', setmode) + def turnoff(self): """ Turn off Thermostat. """ self.writeNodeData("SET_POINT_TEMPERATURE", self.OFF_VALUE) diff --git a/setup.py b/setup.py index 9723a9eff..302267f2a 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ def readme(): PACKAGE_NAME = 'pyhomematic' HERE = os.path.abspath(os.path.dirname(__file__)) -VERSION = '0.1.61' +VERSION = '0.1.62' PACKAGES = find_packages(exclude=['tests', 'tests.*', 'dist', 'build'])