LocaltuyaCover now inherits from LocalTuyaEntity

This commit is contained in:
rospogrigio
2020-09-18 12:50:04 +02:00
committed by rospogrigio
parent 7afd19d197
commit 1a9f7382fc
3 changed files with 47 additions and 98 deletions

View File

@@ -170,6 +170,7 @@ class TuyaCache:
return
# raise ConnectionError("Failed to set status.")
self.update()
def status(self):
"""Get state of Tuya switch and cache the results."""
@@ -204,19 +205,6 @@ class LocaltuyaSwitch(LocalTuyaEntity, SwitchEntity):
)
)
@property
def device_info(self):
return {
"identifiers": {
# Serial numbers are unique identifiers within a specific domain
("LocalTuya", f"local_{self._device.unique_id}")
},
"name": self._device._friendly_name,
"manufacturer": "Tuya generic",
"model": "SmartSwitch",
"sw_version": "3.3",
}
@property
def is_on(self):
"""Check if Tuya switch is on."""