mirror of
https://github.com/home-assistant/core.git
synced 2025-08-05 13:45: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':
|
||||
new_entity = InsteonPLMOpenClosedDevice(device, state_key)
|
||||
|
||||
_LOGGER.debug('Created Switch device with address %s', new_entity.address)
|
||||
|
||||
if new_entity is not None:
|
||||
async_add_devices([new_entity])
|
||||
|
||||
@@ -80,11 +82,11 @@ class InsteonPLMSwitchDevice(SwitchDevice):
|
||||
onlevel = self._insteon_device_state.value
|
||||
return bool(onlevel)
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Provide attributes for display on device card."""
|
||||
insteon_plm = get_component('insteon_plm')
|
||||
return insteon_plm.common_attributes(self)
|
||||
#@property
|
||||
#def device_state_attributes(self):
|
||||
# """Provide attributes for display on device card."""
|
||||
# insteon_plm = get_component('insteon_plm')
|
||||
# return insteon_plm.common_attributes(self)
|
||||
|
||||
@callback
|
||||
def async_switch_update(self, deviceid, statename, val):
|
||||
@@ -129,6 +131,10 @@ class InsteonPLMOpenClosedDevice(SwitchDevice):
|
||||
"""Return the address of the node."""
|
||||
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
|
||||
def name(self):
|
||||
"""Return the name of the node (used for Entity_ID)."""
|
||||
@@ -146,12 +152,12 @@ class InsteonPLMOpenClosedDevice(SwitchDevice):
|
||||
onlevel = self._insteon_device_state.value
|
||||
return bool(onlevel)
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Provide attributes for display on device card."""
|
||||
insteon_plm = get_component('insteon_plm')
|
||||
return insteon_plm.common_attributes(self._insteon_device,
|
||||
self._insteon_device_state)
|
||||
#@property
|
||||
#def device_state_attributes(self):
|
||||
# """Provide attributes for display on device card."""
|
||||
# insteon_plm = get_component('insteon_plm')
|
||||
# return insteon_plm.common_attributes(self._insteon_device,
|
||||
# self._insteon_device_state)
|
||||
|
||||
@callback
|
||||
def async_relay_update(self, deviceid, statename, val):
|
||||
|
Reference in New Issue
Block a user