Skip to content

Check README for supported models #684

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 3 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ jobs:
- name: "Run check-ast"
run: |
poetry run pre-commit run check-ast --all-files
- name: "Check README for supported models"
run: |
poetry run python -m devtools.check_readme_vs_fixtures


tests:
name: Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }}
Expand Down
36 changes: 25 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Note, that this works currently only on kasa-branded devices which use port 9999
In principle, most kasa-branded devices that are locally controllable using the official Kasa mobile app work with this library.

The following lists the devices that have been manually verified to work.
**If your device is unlisted but working, please open a pull request to update the list and add a fixture file (use `devtools/dump_devinfo.py` to generate one).**
**If your device is unlisted but working, please open a pull request to update the list and add a fixture file (use `python -m devtools.dump_devinfo` to generate one).**

### Plugs

Expand All @@ -228,10 +228,10 @@ The following lists the devices that have been manually verified to work.
* KP105
* KP115
* KP125
* KP125M [See note below](#tapo-and-newer-kasa-branded-devices)
* KP125M [See note below](#newer-kasa-branded-devices)
* KP401
* EP10
* EP25 [See note below](#tapo-and-newer-kasa-branded-devices)
* EP25 [See note below](#newer-kasa-branded-devices)

### Power Strips

Expand Down Expand Up @@ -273,27 +273,41 @@ The following lists the devices that have been manually verified to work.
* KL420L5
* KL430

### Tapo and newer Kasa branded devices
### Tapo branded devices

The library has recently added a limited supported for devices that carry Tapo branding.

At the moment, the following devices have been confirmed to work:

* Tapo P110 (plug)
* Tapo L530E (bulb)
* Tapo L900-5 (led strip)
* Tapo L900-10 (led strip)
* Kasa KS205 (Wifi/Matter Wall Switch)
* Kasa KS225 (Wifi/Matter Wall Dimmer Switch)
#### Plugs

* Tapo P110
* Tapo P135 (dimming not yet supported)

#### Bulbs

* Tapo L510B
* Tapo L530E

#### Light strips

* Tapo L900-5
* Tapo L900-10
* Tapo L920-5

### Newer Kasa branded devices

Some newer hardware versions of Kasa branded devices are now using the same protocol as
Tapo branded devices. Support for these devices is currently limited as per TAPO branded
devices:

* Kasa EP25 (plug) hw_version 2.6
* Kasa KP125M (plug)
* Kasa KS205 (Wifi/Matter Wall Switch)
* Kasa KS225 (Wifi/Matter Wall Dimmer Switch)


**If your device is unlisted but working, please open a pull request to update the list and add a fixture file (use `devtools/dump_devinfo.py` to generate one).**
**If your device is unlisted but working, please open a pull request to update the list and add a fixture file (use `python -m devtools.dump_devinfo` to generate one).**

## Resources

Expand Down
8 changes: 8 additions & 0 deletions devtools/check_readme_vs_fixtures.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Script that checks if README.md is missing devices that have fixtures."""
import sys

from kasa.tests.conftest import (
ALL_DEVICES,
BULBS,
Expand Down Expand Up @@ -28,6 +30,12 @@ def _get_device_type(dev, typemap):
return "Unknown type"


found_unlisted = False
for dev in ALL_DEVICES:
if dev not in readme:
print(f"{dev} not listed in {_get_device_type(dev, typemap)}")
found_unlisted = True


if found_unlisted:
sys.exit(-1)