Skip to content

Commit

Permalink
Update analog input sensor to return actual 0-10 voltage values with …
Browse files Browse the repository at this point in the history
…fractions (rather than 10x integers). (#35)
  • Loading branch information
k7d authored Jun 7, 2024
1 parent bfd58da commit 7cdb07e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions aiocomfoconnect/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@

UNIT_WATT = "W"
UNIT_KWH = "kWh"
UNIT_VOLT = "V"
UNIT_CELCIUS = "°C"
UNIT_PERCENT = "%"
UNIT_RPM = "rpm"
Expand Down Expand Up @@ -169,10 +170,10 @@ class Sensor:
341: Sensor("sensor_341", None, 341, PdoType.TYPE_CN_UINT32),
SENSOR_FAN_MODE_SUPPLY_3: Sensor("Supply Fan Mode", None, 342, PdoType.TYPE_CN_UINT32),
SENSOR_FAN_MODE_EXHAUST_3: Sensor("Exhaust Fan Mode", None, 343, PdoType.TYPE_CN_UINT32),
SENSOR_ANALOG_INPUT_1: Sensor("Analog Input 1", None, 369, PdoType.TYPE_CN_UINT8),
SENSOR_ANALOG_INPUT_2: Sensor("Analog Input 2", None, 370, PdoType.TYPE_CN_UINT8),
SENSOR_ANALOG_INPUT_3: Sensor("Analog Input 3", None, 371, PdoType.TYPE_CN_UINT8),
SENSOR_ANALOG_INPUT_4: Sensor("Analog Input 4", None, 372, PdoType.TYPE_CN_UINT8),
SENSOR_ANALOG_INPUT_1: Sensor("Analog Input 1", UNIT_VOLT, 369, PdoType.TYPE_CN_UINT8, lambda x: x / 10),
SENSOR_ANALOG_INPUT_2: Sensor("Analog Input 2", UNIT_VOLT, 370, PdoType.TYPE_CN_UINT8, lambda x: x / 10),
SENSOR_ANALOG_INPUT_3: Sensor("Analog Input 3", UNIT_VOLT, 371, PdoType.TYPE_CN_UINT8, lambda x: x / 10),
SENSOR_ANALOG_INPUT_4: Sensor("Analog Input 4", UNIT_VOLT, 372, PdoType.TYPE_CN_UINT8, lambda x: x / 10),
384: Sensor("sensor_384", None, 384, PdoType.TYPE_CN_INT16, lambda x: x / 10),
386: Sensor("sensor_386", None, 386, PdoType.TYPE_CN_BOOL, bool),
400: Sensor("sensor_400", None, 400, PdoType.TYPE_CN_INT16, lambda x: x / 10),
Expand Down

0 comments on commit 7cdb07e

Please sign in to comment.