Fix pydocstyle issues and enable in tox

This commit is contained in:
Pierre Ståhl
2020-09-22 12:30:16 +02:00
parent ec7652b193
commit a18c69f8eb
10 changed files with 59 additions and 39 deletions

View File

@@ -94,7 +94,7 @@ def flow_schema(dps):
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Setup a Tuya switch based on a config entry."""
"""Set up a Tuya switch based on a config entry."""
tuyainterface, entities_to_setup = prepare_setup_entities(config_entry, DOMAIN)
if not entities_to_setup:
return
@@ -152,6 +152,7 @@ class LocaltuyaSwitch(LocalTuyaEntity, SwitchEntity):
@property
def device_state_attributes(self):
"""Return device state attributes."""
attrs = {}
if self._config.get(CONF_CURRENT, "-1") != "-1":
attrs[ATTR_CURRENT] = self.dps(self._config[CONF_CURRENT])