Small code style improvements to Insteon integration (#33662)
* Small code style improvements to Insteon integration * Update homeassistant/components/insteon/utils.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
b00b8ea0c1
commit
61b4d1e8de
6 changed files with 9 additions and 21 deletions
|
@ -55,21 +55,18 @@ class InsteonEntity(Entity):
|
|||
"""Return the name of the node (used for Entity_ID)."""
|
||||
# Set a base description
|
||||
description = self._insteon_device.description
|
||||
if self._insteon_device.description is None:
|
||||
if description is None:
|
||||
description = "Unknown Device"
|
||||
|
||||
# Get an extension label if there is one
|
||||
extension = self._get_label()
|
||||
if extension:
|
||||
extension = f" {extension}"
|
||||
name = f"{description} {self._insteon_device.address.human}{extension}"
|
||||
return name
|
||||
return f"{description} {self._insteon_device.address.human}{extension}"
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Provide attributes for display on device card."""
|
||||
attributes = {"insteon_address": self.address, "insteon_group": self.group}
|
||||
return attributes
|
||||
return {"insteon_address": self.address, "insteon_group": self.group}
|
||||
|
||||
@callback
|
||||
def async_entity_update(self, deviceid, group, val):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue