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
1 changed files with 5 additions and 2 deletions
|
@ -421,8 +421,11 @@ class ChuangMiPlugSwitch(XiaomiPlugGenericSwitch):
|
|||
self._device_features = FEATURE_FLAGS_PLUG_V3
|
||||
self._state_attrs.update({
|
||||
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):
|
||||
"""Turn a channel on."""
|
||||
|
@ -476,7 +479,7 @@ class ChuangMiPlugSwitch(XiaomiPlugGenericSwitch):
|
|||
if 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
|
||||
|
||||
except DeviceException as ex:
|
||||
|
|
Loading…
Add table
Reference in a new issue