Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #228 from danielperna84/devel
Browse files Browse the repository at this point in the history
0.1.57
  • Loading branch information
danielperna84 authored Mar 2, 2019
2 parents fd0b90d + 73ef78f commit 8cfa0dd
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 8 deletions.
6 changes: 5 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 0.1.57 (2019-03-02)
- Fix/add support for HmIP-WTH & HmIP-WTH-2 (Issue #223) @DieterChmod
- Add support for HM-Sec-SFA-SM @danielperna84

Version 0.1.56 (2019-02-19)
- Remove SABOTAGE from HmIP-SMO(-A) (Issue #212) @danielperna84
- Fix resolving names with JSON with SSL @danielperna84
Expand All @@ -8,7 +12,7 @@ Version 0.1.56 (2019-02-19)

Version 0.1.55 (2019-01-24)
- Add support for HmIP-MIOB @danielperna84
- Add suppoer for HmIP-BSL @danielperna84
- Add support for HmIP-BSL @danielperna84
- Add support for HmIP-SWD @danielperna84
- Add support for HmIP-BRC2 @hg8496
- Add support for HmIP-KRC4 @l-mb
Expand Down
3 changes: 2 additions & 1 deletion pyhomematic/devicetypes/actors.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class Switch(GenericSwitch, HelperWorking, HelperRssiPeer):
"""
@property
def ELEMENT(self):
if "LC-Sw2" in self.TYPE:
if "LC-Sw2" in self.TYPE or "Sec-SFA-SM" in self.TYPE:
return [1, 2]
elif "LC-Sw4" in self.TYPE:
return [1, 2, 3, 4]
Expand Down Expand Up @@ -680,6 +680,7 @@ def turn_off_effect(self):
"HM-MOD-Re-8": Switch,
"IT-Switch": Switch,
"REV-Ritter-Switch": Switch,
"HM-Sec-SFA-SM": Switch,
"HM-ES-PMSw1-Pl": SwitchPowermeter,
"HM-ES-PMSw1-Pl-DN-R1": SwitchPowermeter,
"HM-ES-PMSw1-Pl-DN-R2": SwitchPowermeter,
Expand Down
67 changes: 62 additions & 5 deletions pyhomematic/devicetypes/thermostats.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
from pyhomematic.devicetypes.generic import HMDevice
from pyhomematic.devicetypes.sensors import AreaThermostat
from pyhomematic.devicetypes.sensors import AreaThermostat, IPAreaThermostat
from pyhomematic.devicetypes.helper import HelperValveState, HelperBatteryState, HelperLowBat, HelperLowBatIP, HelperRssiPeer

LOG = logging.getLogger(__name__)
Expand Down Expand Up @@ -334,6 +334,63 @@ def turnoff(self):
""" Turn off Thermostat. """
self.writeNodeData("SET_POINT_TEMPERATURE", self.OFF_VALUE)

class IPThermostatWall2(HMThermostat, IPAreaThermostat, HelperLowBatIP):
"""
HmIP-WTH, HmIP-WTH-2
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):
super().__init__(device_description, proxy, resolveparamsets)

# init metadata
self.SENSORNODE.update({"ACTUAL_TEMPERATURE": [1],
"HUMIDITY": [1]})
self.WRITENODE.update({"SET_POINT_TEMPERATURE": [1]})
self.ACTIONNODE.update({"AUTO_MODE": [1],
"MANU_MODE": [1],
"CONTROL_MODE": [1],
"BOOST_MODE": [1]})
self.ATTRIBUTENODE.update({"LOW_BAT": [0],
"OPERATING_VOLTAGE": [0],
"SET_POINT_MODE": [1],
"BOOST_MODE": [1]})

def get_set_temperature(self):
""" Returns the current target temperature. """
return self.getWriteData("SET_POINT_TEMPERATURE")

def set_temperature(self, target_temperature):
""" Set the target temperature. """
try:
target_temperature = float(target_temperature)
except Exception as err:
LOG.debug("Thermostat.set_temperature: Exception %s" % (err,))
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)


DEVICETYPES = {
"HM-CC-VG-1": ThermostatGroup,
"HM-CC-RT-DN": Thermostat,
Expand All @@ -357,10 +414,10 @@ def turnoff(self):
"HmIP-eTRV-B1": IPThermostat,
"HmIP-STHD": IPThermostatWall,
"HmIP-STH": IPThermostatWall,
"HmIP-WTH-2": IPThermostatWall,
"HMIP-WTH-2": IPThermostatWall,
"HMIP-WTH": IPThermostatWall,
"HmIP-WTH": IPThermostatWall,
"HmIP-WTH-2": IPThermostatWall2,
"HMIP-WTH-2": IPThermostatWall2,
"HMIP-WTH": IPThermostatWall2,
"HmIP-WTH": IPThermostatWall2,
"HmIP-BWTH": IPThermostatWall230V,
"HmIP-HEATING": IPThermostat,
}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def readme():

PACKAGE_NAME = 'pyhomematic'
HERE = os.path.abspath(os.path.dirname(__file__))
VERSION = '0.1.56'
VERSION = '0.1.57'

PACKAGES = find_packages(exclude=['tests', 'tests.*', 'dist', 'build'])

Expand Down

0 comments on commit 8cfa0dd

Please sign in to comment.