zha-device-handlers icon indicating copy to clipboard operation
zha-device-handlers copied to clipboard

Make `TS011F` plugs inherit `EnchantedDevice`

Open javicalle opened this issue 3 years ago • 3 comments

There are reports that some Blitzwolf SHP 15 plugs (depending on its version) don't report the On/Off update from the physical device. The herdsman-converters lib have 3 implementations for the TS011F plugs, 2 of them 'implements' the EnchantedDevice approach:

  • https://github.com/Koenkk/zigbee-herdsman-converters/blob/96563772e92eb459bf52c10e241c3a725968bcab/devices/tuya.js#L2185

My assumption is that the use of the EnchantedDevice cannot be harmful. Also I have not located implementations that could be affected if a device starts to behave in a 'standard' way, but there are no guarantees on what will happen and I do not know the scope (of devices) that the change can affect.

If the change is considered too risky, I can try to narrow it down to only the devices that have been reported, but I'll need to check how to match 2 compatible signatures and ensure priority is resolved in the desired order:

        MODEL: "TS011F",
vs 
        MODELS_INFO: [("TS011F", "_TZ3000_u5u4cakc")],

Fix: #1787

javicalle avatar Oct 16 '22 20:10 javicalle

Pull Request Test Coverage Report for Build 3260856818

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 80.067%

Totals Coverage Status
Change from base Build 3259514820: 0.0%
Covered Lines: 5969
Relevant Lines: 7455

💛 - Coveralls

coveralls avatar Oct 16 '22 20:10 coveralls

Codecov Report

Base: 80.06% // Head: 80.06% // No change to project coverage :thumbsup:

Coverage data is based on head (4a63df9) compared to base (fceacf1). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #1833   +/-   ##
=======================================
  Coverage   80.06%   80.06%           
=======================================
  Files         240      240           
  Lines        7455     7455           
=======================================
  Hits         5969     5969           
  Misses       1486     1486           
Impacted Files Coverage Δ
zhaquirks/tuya/ts011f_plug.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov-commenter avatar Oct 16 '22 20:10 codecov-commenter

My experience and is adding it to the class and keep the MODEL and i think we need doing this on all new tuya devices Zigbee and MCU.

First out of the TS011F was the LIDL with updated firmware and more is likely cumming.

MattWestb avatar Oct 17 '22 04:10 MattWestb

Does that mean I can delete ts011f_plug.py from my custom_zha_quirks directory?

Regards Frank

yfands avatar Oct 17 '22 14:10 yfands

Does that mean I can delete ts011f_plug.py from my custom_zha_quirks directory?

Not yet. The PR has been just merged to the code mainstream. It will be included in the next zha-quirks tag/version. There is no a ETA for the version, but for sure will be before the next major HA version (v2022.11).

Sooo, in short: no, but it will be inlcuded in the next HA version.

javicalle avatar Oct 17 '22 15:10 javicalle

The updated quirk is in released HA 2022.10.5.

So feel free updating HA and also before deleting the "temporary quirk" before doing the install then the local is higher priority then the device is being loaded.

After update look for the quirk is being loaded if its one "standard" or one local quirk and also pleas reporting back if its working OK.

MattWestb avatar Oct 22 '22 07:10 MattWestb