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 #166 from danielperna84/devel
Browse files Browse the repository at this point in the history
0.1.48
  • Loading branch information
danielperna84 authored Sep 12, 2018
2 parents 623ec4e + eaf5f13 commit 8d38005
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 1 deletion.
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 0.1.48 (2018-09-13)
- Added Support for HmIP-SWO-PL and HmIP-SWO-B @dickesW
- Fix callbacks for channel 0 @klada

Version 0.1.47 (2018-08-20)
- Fix HmIP-BWTH (Issue #151) @danielperna84
- Added HmIP-KRCA @danielperna84
Expand Down
93 changes: 93 additions & 0 deletions pyhomematic/devicetypes/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,97 @@ def is_raining(self, channel=None):
""" Return True if motion is detected """
return bool(self.getBinaryData("RAINING", channel))

class IPWeatherSensorPlus(HMSensor, HMBinarySensor):
"""HomeMatic IP Weather sensor Plus."""

def __init__(self, device_description, proxy, resolveparamsets=False):
super().__init__(device_description, proxy, resolveparamsets)

# init metadata
self.SENSORNODE.update({"ACTUAL_TEMPERATURE": [1],
"HUMIDITY": [1],
"RAIN_COUNTER": [1],
"WIND_SPEED": [1],
"SUNSHINEDURATION": [1],
"ILLUMINATION": [1]})
self.BINARYNODE.update({"RAINING": [1]})
self.ATTRIBUTENODE.update({"LOW_BAT": [0],
"ERROR_CODE": [0],
"OPERATING_VOLTAGE": [0],
"TEMPERATURE_OUT_OF_RANGE": [0]})

def get_temperature(self, channel=None):
return float(self.getSensorData("ACTUAL_TEMPERATURE", channel))

def get_humidity(self, channel=None):
return int(self.getSensorData("HUMIDITY", channel))

def get_rain_counter(self, channel=None):
return float(self.getSensorData("RAIN_COUNTER", channel))

def get_wind_speed(self, channel=None):
return float(self.getSensorData("WIND_SPEED", channel))

def get_sunshineduration(self, channel=None):
return int(self.getSensorData("SUNSHINEDURATION", channel))

def get_brightness(self, channel=None):
return int(self.getSensorData("ILLUMINATION", channel))

def get_operating_voltage(self, channel=None):
return float(self.getAttributeData("OPERATING_VOLTAGE", channel))

def is_raining(self, channel=None):
return bool(self.getBinaryData("RAINING", channel))

def is_low_batt(self, channel=None):
return bool(self.getAttributeData("LOW_BAT", channel))

def is_temperature_out_of_range(self, channel=None):
return bool(self.getAttributeData("TEMPERATURE_OUT_OF_RANGE", channel))


class IPWeatherSensorBasic(HMSensor, HMBinarySensor):
"""HomeMatic IP Weather sensor Basic."""

def __init__(self, device_description, proxy, resolveparamsets=False):
super().__init__(device_description, proxy, resolveparamsets)

# init metadata
self.SENSORNODE.update({"ACTUAL_TEMPERATURE": [1],
"HUMIDITY": [1],
"WIND_SPEED": [1],
"SUNSHINEDURATION": [1],
"ILLUMINATION": [1]})
self.ATTRIBUTENODE.update({"LOW_BAT": [0],
"ERROR_CODE": [0],
"OPERATING_VOLTAGE": [0],
"TEMPERATURE_OUT_OF_RANGE": [0]})

def get_temperature(self, channel=None):
return float(self.getSensorData("ACTUAL_TEMPERATURE", channel))

def get_humidity(self, channel=None):
return int(self.getSensorData("HUMIDITY", channel))

def get_wind_speed(self, channel=None):
return float(self.getSensorData("WIND_SPEED", channel))

def get_sunshineduration(self, channel=None):
return int(self.getSensorData("SUNSHINEDURATION", channel))

def get_brightness(self, channel=None):
return int(self.getSensorData("ILLUMINATION", channel))

def get_operating_voltage(self, channel=None):
return float(self.getAttributeData("OPERATING_VOLTAGE", channel))

def is_low_batt(self, channel=None):
return bool(self.getAttributeData("LOW_BAT", channel))

def is_temperature_out_of_range(self, channel=None):
return bool(self.getAttributeData("TEMPERATURE_OUT_OF_RANGE", channel))


class IPPassageSensor(HMSensor, HMBinarySensor, HelperEventRemote, HelperLowBatIP):
"""HomeMatic IP Passage Sensor. #2 = right to left, #3 = left to right"""
Expand Down Expand Up @@ -680,6 +771,8 @@ def get_air_pressure(self, channel=None):
"KS550Tech": WeatherSensor,
"KS550LC": WeatherSensor,
"HmIP-SWO-PR": IPWeatherSensor,
"HmIP-SWO-PL": IPWeatherSensorPlus,
"HmIP-SWO-B": IPWeatherSensorBasic,
"WS550": WeatherStation,
"WS888": WeatherStation,
"WS550Tech": WeatherStation,
Expand Down
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.47'
VERSION = '0.1.48'

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

Expand Down

0 comments on commit 8d38005

Please sign in to comment.