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:
Franck Nijhof 2020-04-05 02:58:10 +02:00 committed by GitHub
parent b00b8ea0c1
commit 61b4d1e8de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 21 deletions

View file

@ -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):