Check README for supported models (#684)

* Check README for supported models

* Use poetry for running due to imports

* Update README
This commit is contained in:
Teemu R 2024-01-23 11:14:59 +01:00 committed by GitHub
parent d5fdf05ed2
commit c1f2f8fe67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 37 additions and 11 deletions

View File

@ -47,6 +47,10 @@ jobs:
- name: "Run check-ast" - name: "Run check-ast"
run: | run: |
poetry run pre-commit run check-ast --all-files 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: tests:
name: Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} name: Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }}

View File

@ -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. 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. 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 ### Plugs
@ -228,10 +228,10 @@ The following lists the devices that have been manually verified to work.
* KP105 * KP105
* KP115 * KP115
* KP125 * KP125
* KP125M [See note below](#tapo-and-newer-kasa-branded-devices) * KP125M [See note below](#newer-kasa-branded-devices)
* KP401 * KP401
* EP10 * EP10
* EP25 [See note below](#tapo-and-newer-kasa-branded-devices) * EP25 [See note below](#newer-kasa-branded-devices)
### Power Strips ### Power Strips
@ -273,18 +273,29 @@ The following lists the devices that have been manually verified to work.
* KL420L5 * KL420L5
* KL430 * KL430
### Tapo and newer Kasa branded devices ### Tapo branded devices
The library has recently added a limited supported for devices that carry Tapo branding. 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: At the moment, the following devices have been confirmed to work:
* Tapo P110 (plug) #### Plugs
* Tapo L530E (bulb)
* Tapo L900-5 (led strip) * Tapo P110
* Tapo L900-10 (led strip) * Tapo P135 (dimming not yet supported)
* Kasa KS205 (Wifi/Matter Wall Switch)
* Kasa KS225 (Wifi/Matter Wall Dimmer Switch) #### 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 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 Tapo branded devices. Support for these devices is currently limited as per TAPO branded
@ -292,8 +303,11 @@ devices:
* Kasa EP25 (plug) hw_version 2.6 * Kasa EP25 (plug) hw_version 2.6
* Kasa KP125M (plug) * 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 ## Resources

View File

@ -1,4 +1,6 @@
"""Script that checks if README.md is missing devices that have fixtures.""" """Script that checks if README.md is missing devices that have fixtures."""
import sys
from kasa.tests.conftest import ( from kasa.tests.conftest import (
ALL_DEVICES, ALL_DEVICES,
BULBS, BULBS,
@ -28,6 +30,12 @@ def _get_device_type(dev, typemap):
return "Unknown type" return "Unknown type"
found_unlisted = False
for dev in ALL_DEVICES: for dev in ALL_DEVICES:
if dev not in readme: if dev not in readme:
print(f"{dev} not listed in {_get_device_type(dev, typemap)}") print(f"{dev} not listed in {_get_device_type(dev, typemap)}")
found_unlisted = True
if found_unlisted:
sys.exit(-1)