Skip to content
This repository has been archived by the owner on Jun 12, 2020. It is now read-only.

Commit

Permalink
Add more info to devices attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
vlebourl committed Jun 3, 2020
1 parent 78fb8de commit fc8ffee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion custom_components/tahoma_extended/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ def __init__(self, tahoma_device, controller):
self.tahoma_device = tahoma_device
self.controller = controller
self._name = self.tahoma_device.label
self._widget = self.tahoma_device.widget
self._uiclass = self.tahoma_device.uiclass

@property
def name(self):
Expand All @@ -154,7 +156,12 @@ def name(self):
@property
def device_state_attributes(self):
"""Return the state attributes of the device."""
return {"tahoma_device_id": self.tahoma_device.url}
return {
"tahoma_label": self._name,
"tahoma_widget": self._widget,
"tahoma_uiclass": self._uiclass,
"tahoma_device_id": self.tahoma_device.url,
}

def apply_action(self, cmd_name, *args):
"""Apply Action to Device."""
Expand Down
4 changes: 2 additions & 2 deletions custom_components/tahoma_extended/pyhoma.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,12 +717,12 @@ def label(self):

@property
def command_definitions(self):
"""List of command devinitions."""
"""List of command definitions."""
return self.__definitions['commands']

@property
def state_definitions(self):
"""State of command devinition."""
"""List of state definition."""
return self.__definitions['states']

@property
Expand Down

0 comments on commit fc8ffee

Please sign in to comment.