-
Notifications
You must be signed in to change notification settings - Fork 679
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
RFC: Tuya data refactoring (implicit conversion of tuya.Data
)
#2017
Conversation
Pull Request Test Coverage Report for Build 4217877523
💛 - Coveralls |
Codecov ReportBase: 83.54% // Head: 83.46% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## dev #2017 +/- ##
==========================================
- Coverage 83.54% 83.46% -0.09%
==========================================
Files 249 249
Lines 8022 8037 +15
==========================================
+ Hits 6702 6708 +6
- Misses 1320 1329 +9
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Hi @Shulyaka, thanks once again for your contributions. Firts I will try to put some background info and then I will try to check the code. When firsts Tuya dimmers come, I noticed that will need some work to make it work. I check the code and looking for a solution I found the My goal was also to bring over time all the implementations related to the Tuya MCU devices to the new package as the knowledge and development of the classes allowed me and (once I was confident enough) to migrate all the references and quirks to the new ones classes and delete the old classes so that nobody uses them. Obviously, my forecast has not been fulfilled but in my head it is still the goal to meet. I hope all this explanation helps you understand what I did in |
Totally agree on both approach and future goals. By the way, are all tuya devices MCU? I mean, can they all in theory be migrated to |
First gen tuya TRVs that is using tuya MCU was having the Zigbee manufacture name But i can being "hybrid devices" that looks like normal Zigbee devices but is also sending tuya MCU commands. |
No, they are some Tuya devices behaving 'standard' zigbee devices. Tuya devices are like a bizarre forest where you can find any kind of devices.
Yes, for sure.
Well, I was looking at the |
3974127
to
e2e3a0e
Compare
e2e3a0e
to
5aa720f
Compare
5aa720f
to
56c0f87
Compare
I've split this PR into 3, now it has only left a single change. |
tuya.Data
tuya.Data
tuya.Data
)
Thanks for not giving up. |
I am having fun:) |
c5842e1
to
56c0f87
Compare
@Shulyaka is this still being worked on? I know you split a bunch into separate PR’s. Just checking on this one. Thanks! |
56c0f87
to
75dcc7c
Compare
Hi! Yes. This is the remaining part. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Despite that all the Data
methods are beyond my level I am confident in the tests so...
LGTM
Do we want to merge this for the next zha-quirks release? (so for HA Core 2023.3.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM – don't see any obvious issues 😄
Why not? 😉 |
This is a terrible change, after all, many end users are not experts in this area. |
Can you elaborate it? |
Ok, I am not sure all this is needed and I need your advice.
This PR adds implicit conversions for
tuya.Data
class.tuya.Data.to_value
andtuya.Data.from_value
were removed. Instead the type conversion function were added.