FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add support for tapo bulbs by rytilahti · Pull Request #558 · python-kasa/python-kasa · GitHub

Repository navigation

Add support for tapo bulbs - #558

Merged
rytilahti merged 19 commits into
python-kasa:masterfrom
rytilahti:feat/add_tapobulb
Dec 5, 2023
Merged

rytilahti merged 19 commits into
python-kasa:masterfrom
rytilahti:feat/add_tapobulb

Conversation

rytilahti commented Nov 29, 2023 •
edited
Loading

Copy link
Copy Markdown
Member

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 added the enhancement New feature or request label Nov 29, 2023
Comment thread kasa/aesprotocol.py Fixed
Comment thread kasa/aesprotocol.py Fixed
Comment thread kasa/aesprotocol.py Fixed
rytilahti force-pushed the feat/add_tapobulb branch 2 times, most recently from 842528e to eebfdf1 Compare November 30, 2023 13:03

codecov Bot commented Nov 30, 2023 •
edited
Loading

Copy link
Copy Markdown

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 force-pushed the feat/add_tapobulb branch 4 times, most recently from 2866eee to e1babd3 Compare December 4, 2023 19:03
rytilahti mentioned this pull request Dec 4, 2023
rytilahti marked this pull request as ready for review December 4, 2023 19:22

rytilahti commented Dec 4, 2023 •
edited
Loading

Copy link
Copy Markdown
Member Author

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 added this to the 0.6.0 milestone Dec 5, 2023

Copy link
Copy Markdown
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.

Comment thread kasa/tests/newfakes.py
Comment thread kasa/tests/newfakes.py
Comment thread kasa/tests/conftest.py
Comment thread kasa/tests/conftest.py
Comment thread kasa/tests/conftest.py
Comment thread kasa/tests/conftest.py

sdb9696 commented Dec 5, 2023 •
edited
Loading

Copy link
Copy Markdown
Contributor

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 commented Dec 5, 2023 •
edited
Loading

Copy link
Copy Markdown
Member Author

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 merged commit f9b5003 into python-kasa:master Dec 5, 2023
rytilahti deleted the feat/add_tapobulb branch December 5, 2023 19:07
pillarsdotnet pushed a commit to pillarsdotnet/python-kasa that referenced this pull request Oct 22, 2026
* Add support for tapo light bulbs

* Use TapoDevice for on/off

* Add tapobulbs to discovery

* Add partial support for effects

Activating the effect does not work as I thought it would,
but this implements rest of the interface from SmartLightStrip.

* Add missing __init__ for tapo package

* Make mypy happy

* Add docstrings to make ruff happy

* Implement state_information and has_emeter

* Import tapoplug from kasa.tapo package

* Add tapo L530 fixture

* Enable tests for L530 fixture

* Make ruff happy

* Update fixture filename

* Raise exceptions on invalid parameters

* Return results in a wrapped dict

* Implement set_*

* Reorganize bulbs to iot&smart, fix tests for smarts

* Fix linting

* Fix BULBS_LIGHT_STRIP back to LIGHT_STRIPS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL