diff --git a/custom_components/meross_cloud/light.py b/custom_components/meross_cloud/light.py index 6c80de4ca2..ac6bbd0846 100644 --- a/custom_components/meross_cloud/light.py +++ b/custom_components/meross_cloud/light.py @@ -99,7 +99,6 @@ def hs_color(self): if self._state.get('capacity') == 5: # rgb mode rgb = rgb_int_to_tuple(self._state.get('rgb')) - _LOGGER.info("rgb: %s" % str(rgb)) return color_util.color_RGB_to_hs(*rgb) return None diff --git a/custom_components/meross_cloud/switch.py b/custom_components/meross_cloud/switch.py index a65a9aa834..eddfbd704c 100644 --- a/custom_components/meross_cloud/switch.py +++ b/custom_components/meross_cloud/switch.py @@ -12,22 +12,22 @@ class SwitchEntityWrapper(SwitchDevice, AbstractMerossEntityWrapper): """Wrapper class to adapt the Meross switches into the Homeassistant platform""" def __init__(self, device: GenericPlug, channel: int): - super().__init__(device) - - # Device properties - self._channel_id = channel - self._device_id = device.uuid - self._device_name = device.name - # If the current device has more than 1 channel, we need to setup the device name and id accordingly if len(device.get_channels()) > 1: - self._id = calculate_switch_id(self._device.uuid, channel) + self._id = calculate_switch_id(device.uuid, channel) channelData = device.get_channels()[channel] self._entity_name = "{} - {}".format(device.name, channelData.get('devName', 'Main Switch')) else: self._id = device.uuid self._entity_name = device.name + super().__init__(device) + + # Device properties + self._channel_id = channel + self._device_id = device.uuid + self._device_name = device.name + # Device specific state self._is_on = None if self._is_online: