mirror of
https://github.com/home-assistant/core.git
synced 2025-11-14 13:30:43 +00:00
Add mysensors binary sensor
* Add mysensors binary sensor. * Add discovery platforms to binary_sensor base component. * Replace device_state_attributes with state_attributes in binary_sensor base class. * Fix docstrings. * Add discovery of binary sensor to mysensors component. * Add child.type as argument to mysensors device_class. * Move binary sensor types from sensor to binary_sensor module. * Fix binary_sensor attribute tests. Use state_attributes instead of device_state_attributes.
This commit is contained in:
@@ -42,12 +42,14 @@ GATEWAYS = None
|
||||
DISCOVER_SENSORS = 'mysensors.sensors'
|
||||
DISCOVER_SWITCHES = 'mysensors.switches'
|
||||
DISCOVER_LIGHTS = 'mysensors.lights'
|
||||
DISCOVER_BINARY_SENSORS = 'mysensors.binary_sensor'
|
||||
|
||||
# Maps discovered services to their platforms
|
||||
DISCOVERY_COMPONENTS = [
|
||||
('sensor', DISCOVER_SENSORS),
|
||||
('switch', DISCOVER_SWITCHES),
|
||||
('light', DISCOVER_LIGHTS),
|
||||
('binary_sensor', DISCOVER_BINARY_SENSORS),
|
||||
]
|
||||
|
||||
|
||||
@@ -148,7 +150,7 @@ def pf_callback_factory(map_sv_types, devices, add_devices, entity_class):
|
||||
else:
|
||||
device_class = entity_class
|
||||
devices[key] = device_class(
|
||||
gateway, node_id, child.id, name, value_type)
|
||||
gateway, node_id, child.id, name, value_type, child.type)
|
||||
|
||||
_LOGGER.info('Adding new devices: %s', devices[key])
|
||||
add_devices([devices[key]])
|
||||
|
||||
Reference in New Issue
Block a user