localtuya icon indicating copy to clipboard operation
localtuya copied to clipboard

Label DPs with cloud API descriptions if available

Open wgrant opened this issue 2 years ago • 11 comments

The Tuya cloud Get Device Specification Attribute API provides a name for most DPs for most devices. When configuring a device, include that name if it's available.

Screenshot from 2023-01-21 10-48-51

wgrant avatar Jan 20 '23 23:01 wgrant

Great!

SamJongenelen avatar Jan 22 '23 08:01 SamJongenelen

It could be quite useful

patrik-malina avatar Jan 22 '23 15:01 patrik-malina

Not sure if it's working on edit; tested via merging your branch into https://github.com/CloCkWeRX/localtuya-experimental

When I edit an existing device; I see:

image

No relevant failures in the logs, so either it's not being invoked via edit or I've done something wrong when deploying. Fairly confident these DPs would be labelled

CloCkWeRX avatar Jan 23 '23 10:01 CloCkWeRX

Not sure if it's working on edit

The DP strings (previously including values, and now including names) are cached for existing devices -- grep for CONF_DPS_STRINGS. I don't know of an existing way to invalidate this cache other than manually removing the dps_strings values from core.config_entries.

wgrant avatar Jan 23 '23 10:01 wgrant

Alright, much happier now: image

This makes life significantly easier! Potentially could self configure some DPs if the naming is 1:1 automagically; or detect platform.

CloCkWeRX avatar Jan 23 '23 11:01 CloCkWeRX

@rospogrigio after you land the stability fixes, I feel like this one is a good feature to include. Tested locally; seems happy.

CloCkWeRX avatar Feb 09 '23 12:02 CloCkWeRX

Wish to have this merged please

darth-hp avatar Feb 06 '24 10:02 darth-hp

I logged in just to say this would have helped me a lot. Any reviewer able to merge it?

vrioux avatar Feb 06 '24 13:02 vrioux

No only I can merge it but I am having a super tough period, I'll do it as soon as I can. Thank you for your understanding, bye

rospogrigio avatar Feb 06 '24 13:02 rospogrigio

Probably it's a good idea to allow other to chime into the project? With nearly 1000 issues and 100 pull requests there is a lot of demand and a lot of will to collaborate, right?

darth-hp avatar Feb 06 '24 13:02 darth-hp

@rospogrigio what's the missing ci for merging?

darth-hp avatar May 06 '24 11:05 darth-hp