SonoffLAN icon indicating copy to clipboard operation
SonoffLAN copied to clipboard

New Supervisor core-2021.4.0b0 breaks EWeLinkToggle light/turn_on

Open Hhavoc opened this issue 5 years ago • 18 comments

Device: Sonoff RFR3 inline switch with RF Firmware: PSF-BD1-GL v3.6.0 (using local & cloud) SonoffLAN v.2.4.2

When switching on via Home Assistant, it fails, and I get message, Failed to call service light/turn_on. 'EWeLinkToggle' object has no attribute 'supported_color_modes'

https://github.com/home-assistant/core/commit/5f2326fb5756b85255cec27d3b2172c44bc66058 indicates SUPPORT_COLOR is now deprecated, replaced by "color modes". Below is rundown of new attribute for color modes.

Color mode of the light

ATTR_COLOR_MODE = "color_mode"

List of color modes supported by the light

ATTR_SUPPORTED_COLOR_MODES = "supported_color_modes"

Possible color modes

COLOR_MODE_UNKNOWN = "unknown" # Ambiguous color mode COLOR_MODE_ONOFF = "onoff" # Must be the only supported mode COLOR_MODE_BRIGHTNESS = "brightness" # Must be the only supported mode COLOR_MODE_COLOR_TEMP = "color_temp" COLOR_MODE_HS = "hs" COLOR_MODE_XY = "xy" COLOR_MODE_RGB = "rgb" COLOR_MODE_RGBW = "rgbw" COLOR_MODE_RGBWW = "rgbww"

Hhavoc avatar Apr 01 '21 19:04 Hhavoc

I’m also getting this issue

mcinnes01 avatar Apr 01 '21 20:04 mcinnes01

Same problem here. Pls update ASAP

camui-alexandru avatar Apr 03 '21 09:04 camui-alexandru

Same problem :(

huuub avatar Apr 05 '21 11:04 huuub

please fix it, the same with core-2021-4.0

alloro72 avatar Apr 07 '21 19:04 alloro72

Same problem with sonoff basic2 firmware 3.5 and sonoff touch US firmware 3.5 Anyone is working on that bug?

acolmano avatar Apr 07 '21 22:04 acolmano

i Have same problem with sonoff mini and firmware 3.6

zorankrnjajic avatar Apr 07 '21 22:04 zorankrnjajic

Same problem with same error.

craigthompson avatar Apr 08 '21 04:04 craigthompson

Looks like SUPPORT_COLOR is now deprecated, replaced by "color modes"

camui-alexandru avatar Apr 08 '21 05:04 camui-alexandru

Same for me, someone has find a solution?

andyz68 avatar Apr 08 '21 06:04 andyz68

same for me, wait a update

maverik80 avatar Apr 08 '21 07:04 maverik80

Ran into the same problem. Made some minor changes to switch.py to get it working again while we wait for an update.

At switch.py line 75 replace this:

    @property
    def state_attributes(self):
        return self._attrs

with this:

    @property
    def state_attributes(self):
        # return self._attrs
        return {
            **self._attrs,
            "supported_color_modes": "onoff"
        }

    @property
    def supported_color_modes(self):
        return "onoff"

Restart Home Assistant and you should be good to go!

Cheers!

michielton avatar Apr 08 '21 09:04 michielton

Ran into the same problem. Made some minor changes to switch.py to get it working again while we wait for an update.

At switch.py line 75 replace this:

    @property
    def state_attributes(self):
        return self._attrs

with this:

    @property
    def state_attributes(self):
        # return self._attrs
        return {
            **self._attrs,
            "supported_color_modes": "onoff"
        }

    @property
    def supported_color_modes(self):
        return "onoff"

Restart Home Assistant and you should be good to go!

Cheers!

Works! Thank you.

andyz68 avatar Apr 08 '21 10:04 andyz68

Mi sono imbattuto nello stesso problema. Ho apportato alcune piccole modifiche per switch.pyfarlo funzionare di nuovo in attesa di un aggiornamento.

A switch.py line 75sostituire questo:

    @property
    def state_attributes(self):
        return self._attrs

con questo:

    @property
    def state_attributes(self):
        # return self._attrs
        return {
            **self._attrs,
            "supported_color_modes": "onoff"
        }

    @property
    def supported_color_modes(self):
        return "onoff"

Riavvia Home Assistant e dovresti essere pronto per partire!

Saluti!

Thanks man

maverik80 avatar Apr 08 '21 10:04 maverik80

Updated to v2.4.3 and this also fixed the problem, so no need for the manual changes to switch.py anymore.

Thanks @AlexxIT

michielton avatar Apr 08 '21 10:04 michielton

Updated to 2.4.3, very fast to react ! Thanks a lot @AlexxIT .

luccyo avatar Apr 08 '21 10:04 luccyo

Thanks @AlexxIT

dtalens avatar Apr 08 '21 11:04 dtalens

This patch works for me Thanks

acolmano avatar Apr 08 '21 12:04 acolmano

Awesome work thanks :)

mcinnes01 avatar Apr 08 '21 15:04 mcinnes01