forked from platypush/platypush
Support for bluetooth
devices with multiple temperature sensors.
This commit is contained in:
parent
56d693032a
commit
886b930e2f
1 changed files with 32 additions and 0 deletions
|
@ -58,6 +58,10 @@ class NullSensor:
|
|||
# Maps property names to transformer methods (first mapper choice).
|
||||
_property_to_entity: Dict[str, Callable[[Any, Dict[str, Any]], Entity]] = {
|
||||
'activity heart rate': lambda value, _: HeartRateSensor(value=value),
|
||||
'atmospheric pressure': lambda value, conf: PressureSensor(
|
||||
value=value,
|
||||
unit=conf.get('unit'),
|
||||
),
|
||||
'battery': lambda value, conf: Battery(
|
||||
value=value,
|
||||
unit=conf.get('unit', '%'),
|
||||
|
@ -108,6 +112,34 @@ _property_to_entity: Dict[str, Callable[[Any, Dict[str, Any]], Entity]] = {
|
|||
value=value,
|
||||
unit=conf.get('unit', 'C'),
|
||||
),
|
||||
'temperature2': lambda value, conf: TemperatureSensor(
|
||||
value=value,
|
||||
unit=conf.get('unit', 'C'),
|
||||
),
|
||||
'temperature3': lambda value, conf: TemperatureSensor(
|
||||
value=value,
|
||||
unit=conf.get('unit', 'C'),
|
||||
),
|
||||
'temperature4': lambda value, conf: TemperatureSensor(
|
||||
value=value,
|
||||
unit=conf.get('unit', 'C'),
|
||||
),
|
||||
'temperature5': lambda value, conf: TemperatureSensor(
|
||||
value=value,
|
||||
unit=conf.get('unit', 'C'),
|
||||
),
|
||||
'temperature6': lambda value, conf: TemperatureSensor(
|
||||
value=value,
|
||||
unit=conf.get('unit', 'C'),
|
||||
),
|
||||
'temperature7': lambda value, conf: TemperatureSensor(
|
||||
value=value,
|
||||
unit=conf.get('unit', 'C'),
|
||||
),
|
||||
'temperature8': lambda value, conf: TemperatureSensor(
|
||||
value=value,
|
||||
unit=conf.get('unit', 'C'),
|
||||
),
|
||||
'voltage': lambda value, conf: VoltageSensor(
|
||||
value=value,
|
||||
unit=conf.get('unit', 'V'),
|
||||
|
|
Loading…
Reference in a new issue