Skip to content
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

Implement introspectable switches #1494

Merged
merged 4 commits into from
Aug 14, 2022
Merged

Conversation

rytilahti
Copy link
Owner

@rytilahti rytilahti commented Aug 13, 2022

Continuing on adding more introspectable properties (follow-up to #1488), this PR adds support for toggleable switches and implements them for PowerStrip.
The home assistant using this information is available at https://github.com/rytilahti/home-assistant/tree/xiaomi_miio/feat/entities_from_upstream

Here is how the powerstrip looks currently in homeassistant:
image

Next step is adding support for settings (select platform), but it may take a bit longer as I don't have devices to test on prior cleaning up the vacuum platform integration to use the common facilities.

Ping @syssi @Kirmas @starkillerOG - feel free to test and start adding switches to integrations. Let me know if you encounter any issues or think that something should be changed, we can still adjust the API as needed.

@codecov-commenter
Copy link

codecov-commenter commented Aug 13, 2022

Codecov Report

Merging #1494 (1d6496c) into master (d872d55) will increase coverage by 0.00%.
The diff coverage is 90.32%.

@@            Coverage Diff            @@
##           master    #1494     +/-   ##
=========================================
  Coverage   82.59%   82.59%             
=========================================
  Files         142      142             
  Lines       14009    14033     +24     
  Branches     1583     3345   +1762     
=========================================
+ Hits        11571    11591     +20     
- Misses       2219     2222      +3     
- Partials      219      220      +1     
Impacted Files Coverage Δ
miio/powerstrip.py 94.30% <62.50%> (-2.31%) ⬇️
miio/descriptors.py 100.00% <100.00%> (ø)
miio/device.py 56.62% <100.00%> (+1.41%) ⬆️
miio/devicestatus.py 96.00% <100.00%> (-4.00%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@rytilahti rytilahti merged commit cf90f2c into master Aug 14, 2022
@rytilahti rytilahti deleted the feat/introspectable_switches branch August 14, 2022 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants