-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Device Support: Parkside water valve _TZE200_htnnfasr #1574
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #1574 +/- ##
==========================================
+ Coverage 80.27% 80.29% +0.02%
==========================================
Files 231 231
Lines 6904 6927 +23
==========================================
+ Hits 5542 5562 +20
- Misses 1362 1365 +3 ☔ View full report in Codecov by Sentry. |
Please look at the folder structure. I put the quirk in LIDL folder, but pytest is uses regular tuya naming |
Pull Request Test Coverage Report for Build 2382658234
💛 - Coveralls |
I have pointing out before that the LIDK folder shall being merged to the tuya for not getting one "Z2M" structure then having 15 different names / folders for the more or less the same device, GREAT WORK DONE Augsburg !! |
c450fd5
to
e15bb89
Compare
I'm not sure now, but I believe that there's no need for the There is also another approach that could be usefull for casting that Tuya spell around the devices.
class BewitchedDevice(CustomDevice):
"""Cast a magic spell for Tuya devices that needed."""
def __init__(self, *args, **kwargs):
"""Initialize with task."""
super().__init__(*args, **kwargs)
# cast_tuya_magic_spell(self, tries=3)
self._init_plug_task = asyncio.create_task(self.spell())
async def spell(self) -> None:
"""Initialize device so that all endpoints become available."""
basic_cluster = self.endpoints[1].in_clusters[0]
_LOGGER.debug("Device class will cast Tuya Magic Spell")
attr_to_read = [4, 0, 1, 5, 7, 0xFFFE]
await basic_cluster.read_attributes(attr_to_read)
class ParksidePSBZS(BewitchedDevice, CustomDevice):
"""LIDL Parkside water without implemented scheduler."""
signature = {
MODELS_INFO: [("_TZE200_htnnfasr", "TS0601")], # HG06875
ENDPOINTS: {
# <SimpleDescriptor endpoint=1 profile=260 device_type=0
.../... Some comments:
What do you think? |
Ahhh! and I agree to put the class inside the Tuya folder( |
@javicalle We was first needing it for the famous TS004F DSR but our hubart friends is using it on many MCU devices that looks need it being casted for getting all function working OK (most temp and humidity sensors with display) and also the updated LIDL power strips is needing it for using all 3 endpoint (its one "normal" Zigbee device). I think it can being good implanting the tMS (tuya Magic Spell) casting for all MCU devices but its need testing so not braking devices if its changing the device functionality of the device. One side note of tuya MCU devices is the Zigbee module from the factory not having its real manufacture name then its being flashed its using one standard factory ones but then connecting to one tuya MCU its getting one updated manufacture name its storing in the NVM (flash region "user data") and is using it in the Zigbee network (have getting one dumped user data and flash from one tuya TRV that is verifying the data settings of the Zigbee module). And i think the tMS casting is also making some things being sent from the zigbee module to the MCU for getting it initiated OK. |
For some reason it wasn't enough, because I've begun with that class. I saw it in the other Irrigation valve PR, but had no success.
I don't like the generic word valve, because it can be the Thermostatic Valve or Gas Valve. ts0601_water_valve is easier to understand. |
Ok, then I would prefer without the 'new' part. Just
I see your point, but IMO the question would be which devices use this implementation and not 'what are these devices used for' (water, gas, ...) Recently, another 'valve' has appeared that can be used for water or gas:
IMO I would put all the valves in the same class. But it's not something that bothers me too much. |
The original zha-device-handlers/zhaquirks/tuya/__init__.py Lines 793 to 805 in c7f2c61
|
The tuya MCU is sending battery power left as 100% that is OK for there cloud but Zigbee standard is saying it shall being sent 200% then the battery is full. |
f54324d
to
b110ce3
Compare
all proposed changes have been applied, but two things: Do any of you know how to test following methods:
and
it can be merged without this tests, but the coverage percentage is lower. |
Adding support for LIDL PARKSIDE Water Valve
Following is supported by the quirk:
Support not planned:
This PR closes this #933 and #1452
This can be merged before solving following issue #1566 because quirk will stay as is.