mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 13:57:10 +00:00
Remove load power attribute for channel USB (#14996)
* Remove load power attribute for channel USB * Fix format
This commit is contained in:
parent
656eae288e
commit
c5f012c85a
@ -421,8 +421,11 @@ class ChuangMiPlugSwitch(XiaomiPlugGenericSwitch):
|
|||||||
self._device_features = FEATURE_FLAGS_PLUG_V3
|
self._device_features = FEATURE_FLAGS_PLUG_V3
|
||||||
self._state_attrs.update({
|
self._state_attrs.update({
|
||||||
ATTR_WIFI_LED: None,
|
ATTR_WIFI_LED: None,
|
||||||
ATTR_LOAD_POWER: None,
|
|
||||||
})
|
})
|
||||||
|
if self._channel_usb is False:
|
||||||
|
self._state_attrs.update({
|
||||||
|
ATTR_LOAD_POWER: None,
|
||||||
|
})
|
||||||
|
|
||||||
async def async_turn_on(self, **kwargs):
|
async def async_turn_on(self, **kwargs):
|
||||||
"""Turn a channel on."""
|
"""Turn a channel on."""
|
||||||
@ -476,7 +479,7 @@ class ChuangMiPlugSwitch(XiaomiPlugGenericSwitch):
|
|||||||
if state.wifi_led:
|
if state.wifi_led:
|
||||||
self._state_attrs[ATTR_WIFI_LED] = state.wifi_led
|
self._state_attrs[ATTR_WIFI_LED] = state.wifi_led
|
||||||
|
|
||||||
if state.load_power:
|
if self._channel_usb is False and state.load_power:
|
||||||
self._state_attrs[ATTR_LOAD_POWER] = state.load_power
|
self._state_attrs[ATTR_LOAD_POWER] = state.load_power
|
||||||
|
|
||||||
except DeviceException as ex:
|
except DeviceException as ex:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user