Revert changes to platforms using self.device (#16209)
* Revert tank_utility * Fix Soundtouch * Fix Plex * Fix Emby * Fix Radiotherm * Fix Juicenet * Fix Qwikswitch * Fix Xiaomi miio * Fix Nest * Fix Tellduslive * Fix KNX
This commit is contained in:
1 parent
289b1802fd
commit
5341785aae
28 files changed
+256
-237
No files matched your search
@@ -63,7 +63,7 @@ class KNXSwitch(SwitchDevice):
|
||||
|
||||
def __init__(self, hass, device):
|
||||
"""Initialize of KNX switch."""
|
||||
self._device = device
|
||||
self.device = device
|
||||
self.hass = hass
|
||||
self.async_register_callbacks()
|
||||
|
||||
@@ -73,12 +73,12 @@ class KNXSwitch(SwitchDevice):
|
||||
async def after_update_callback(device):
|
||||
"""Call after device was updated."""
|
||||
await self.async_update_ha_state()
|
||||
self._device.register_device_updated_cb(after_update_callback)
|
||||
self.device.register_device_updated_cb(after_update_callback)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Return the name of the KNX device."""
|
||||
return self._device.name
|
||||
return self.device.name
|
||||
|
||||
@property
|
||||
def available(self):
|
||||
@@ -93,12 +93,12 @@ class KNXSwitch(SwitchDevice):
|
||||
@property
|
||||
def is_on(self):
|
||||
"""Return true if device is on."""
|
||||
return self._device.state
|
||||
return self.device.state
|
||||
|
||||
async def async_turn_on(self, **kwargs):
|
||||
"""Turn the device on."""
|
||||
await self._device.set_on()
|
||||
await self.device.set_on()
|
||||
|
||||
async def async_turn_off(self, **kwargs):
|
||||
"""Turn the device off."""
|
||||
await self._device.set_off()
|
||||
await self.device.set_off()
|
||||
@@ -28,14 +28,14 @@ class TelldusLiveSwitch(TelldusLiveEntity, ToggleEntity):
|
||||
@property
|
||||
def is_on(self):
|
||||
"""Return true if switch is on."""
|
||||
return self._device.is_on
|
||||
return self.device.is_on
|
||||
|
||||
def turn_on(self, **kwargs):
|
||||
"""Turn the switch on."""
|
||||
self._device.turn_on()
|
||||
self.device.turn_on()
|
||||
self.changed()
|
||||
|
||||
def turn_off(self, **kwargs):
|
||||
"""Turn the switch off."""
|
||||
self._device.turn_off()
|
||||
self.device.turn_off()
|
||||
self.changed()
|
||||
Reference in new issue
Block a user