8000 Add support for tapo bulbs by rytilahti · Pull Request #558 · python-kasa/python-kasa · GitHub
[go: up one dir, main page]

Skip to content

Add support for tapo bulbs #558

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

Merged
merged 19 commits into from
Dec 5, 2023
Merged

Conversation

rytilahti
Copy link
Member
@rytilahti rytilahti commented Nov 29, 2023

This is a preliminary PR to add support for tapo bulbs.

Basic functionality is tested to work with L530 but this is still a WIP.
Based on #552 which should be merged before this.

Cli output

== smarte WLAN-Glühbirne - L530 ==
        Host: 192.168.xx.xx
        Port: None
        Device state: True
        == Generic information ==
        Time:         2023-12-03 17:09:22+01:00 (tz: {'timezone': 'Europe/Berlin'}
        Hardware:     3.0
        Software:     1.0.6 Build 230509 Rel.195312
        MAC (rssi):   5C:E9:31:xx:xx:xx (-38)
        Location:     {'latitude': 0, 'longitude': 0}

        == Device specific information ==
        Brightness: 100
        Is dimmable: True
        Color temperature: 6000
        Valid temperature range: ColorTempRange(min=2500, max=6500)
        HSV: HSV(hue=0, saturation=100, value=100)
        Presets:

        == Current State ==
Got error: SmartDeviceException('update() required prior accessing emeter')

Note, the discovery reports the model as L530E in contrast to sysinfo response.

@rytilahti rytilahti added the enhancement New feature or request label Nov 29, 2023
@rytilahti rytilahti force-pushed the feat/add_tapobulb branch 2 times, most recently from 842528e to eebfdf1 Compare November 30, 2023 13:03
Copy link
codecov bot commented Nov 30, 2023

Codecov Report

Attention: 23 lines in your changes are missing coverage. Please review.

Comparison is base (5febd30) 79.66% compared to head (5a9dec9) 79.56%.

Files Patch % Lines
kasa/tapo/tapobulb.py 73.25% 15 Missing and 8 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #558      +/-   ##
==========================================
- Coverage   79.66%   79.56%   -0.11%     
==========================================
  Files          36       37       +1     
  Lines        2995     3083      +88     
  Branches      779      804      +25     
==========================================
+ Hits         2386     2453      +67     
- Misses        536      548      +12     
- Partials       73       82       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rytilahti rytilahti force-pushed the feat/add_tapobulb branch 4 times, most recently from 2866eee to e1babd3 Compare December 4, 2023 19:03
@rytilahti rytilahti mentioned this pull request Dec 4, 2023
@rytilahti rytilahti marked this pull request as ready for review December 4, 2023 19:22
@rytilahti
Copy link
Member Author
rytilahti commented Dec 4, 2023

The bulbs are organized to separate categories for testing depending on the available features. I think this requires some restructuring to avoid duplicating the categorization per device family, perhaps this should wait until we have device type interfaces in place.

@rytilahti rytilahti added this to the 0.6.0 milestone Dec 5, 2023
@rytilahti
Copy link
Member Author

Oddly enough, the discovery response differs from the sysinfo response on the model information. Anyway, I think we should just merge and continue improving it in other PRs.

@sdb9696
Copy link
Collaborator
sdb9696 commented Dec 5, 2023

Oddly enough, the discovery response differs from the sysinfo response on the model information. Anyway, I think we should just merge and continue improving it in other PRs.

Do you mean discovery has (EU) on the end and get_device_info doesn't? That's how I got tripped up dropping the region from the fixture name.

Other than that everything else looks great. I've just put comments here but in future do you want me to start a review and approve etc?

@rytilahti
Copy link
Member Author
rytilahti commented Dec 5, 2023

Do you mean discovery has (EU) on the end and get_device_info doesn't? That's how I got tripped up dropping the region from the fixture name.

Ahh, indeed, didn't notice that but it's a non-issue! :-)

Other than that everything else looks great. I've just put comments here but in future do you want me to start a review and approve etc?

Great, thanks! Sure thing, an extra pair of eyes looking over the changes is always appreciated.

I'll merge this now and leave further improvements and cleanups for future PRs.

@rytilahti rytilahti merged commit f9b5003 into python-kasa:master Dec 5, 2023
@rytilahti rytilahti deleted the feat/add_tapobulb branch December 5, 2023 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0