mirror of
https://github.com/home-assistant/core.git
synced 2025-08-06 14:15:12 +02:00
Debug adding devices to hass
This commit is contained in:
@@ -37,6 +37,8 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
|||||||
elif state_name == 'openClosedRelay':
|
elif state_name == 'openClosedRelay':
|
||||||
new_entity = InsteonPLMOpenClosedDevice(device, state_key)
|
new_entity = InsteonPLMOpenClosedDevice(device, state_key)
|
||||||
|
|
||||||
|
_LOGGER.debug('Created Switch device with address %s', new_entity.address)
|
||||||
|
|
||||||
if new_entity is not None:
|
if new_entity is not None:
|
||||||
async_add_devices([new_entity])
|
async_add_devices([new_entity])
|
||||||
|
|
||||||
@@ -80,11 +82,11 @@ class InsteonPLMSwitchDevice(SwitchDevice):
|
|||||||
onlevel = self._insteon_device_state.value
|
onlevel = self._insteon_device_state.value
|
||||||
return bool(onlevel)
|
return bool(onlevel)
|
||||||
|
|
||||||
@property
|
#@property
|
||||||
def device_state_attributes(self):
|
#def device_state_attributes(self):
|
||||||
"""Provide attributes for display on device card."""
|
# """Provide attributes for display on device card."""
|
||||||
insteon_plm = get_component('insteon_plm')
|
# insteon_plm = get_component('insteon_plm')
|
||||||
return insteon_plm.common_attributes(self)
|
# return insteon_plm.common_attributes(self)
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_switch_update(self, deviceid, statename, val):
|
def async_switch_update(self, deviceid, statename, val):
|
||||||
@@ -129,6 +131,10 @@ class InsteonPLMOpenClosedDevice(SwitchDevice):
|
|||||||
"""Return the address of the node."""
|
"""Return the address of the node."""
|
||||||
return self._insteon_device.address.human
|
return self._insteon_device.address.human
|
||||||
|
|
||||||
|
def group(self):
|
||||||
|
"""Return the INSTEON group that the entity responds to."""
|
||||||
|
return self._insteon_device_state.group
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
"""Return the name of the node (used for Entity_ID)."""
|
"""Return the name of the node (used for Entity_ID)."""
|
||||||
@@ -146,12 +152,12 @@ class InsteonPLMOpenClosedDevice(SwitchDevice):
|
|||||||
onlevel = self._insteon_device_state.value
|
onlevel = self._insteon_device_state.value
|
||||||
return bool(onlevel)
|
return bool(onlevel)
|
||||||
|
|
||||||
@property
|
#@property
|
||||||
def device_state_attributes(self):
|
#def device_state_attributes(self):
|
||||||
"""Provide attributes for display on device card."""
|
# """Provide attributes for display on device card."""
|
||||||
insteon_plm = get_component('insteon_plm')
|
# insteon_plm = get_component('insteon_plm')
|
||||||
return insteon_plm.common_attributes(self._insteon_device,
|
# return insteon_plm.common_attributes(self._insteon_device,
|
||||||
self._insteon_device_state)
|
# self._insteon_device_state)
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_relay_update(self, deviceid, statename, val):
|
def async_relay_update(self, deviceid, statename, val):
|
||||||
|
Reference in New Issue
Block a user