mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-01-09 06:17:08 +00:00
Add script to check supported devices, update README (#242)
* check_readme_vs_fixtures.py checks if a device with a fixture is listed in the README * Add missing entries to README.md
This commit is contained in:
parent
d75e1adaba
commit
8a4068c623
@ -119,10 +119,13 @@ or the `parse_pcap.py` script contained inside the `devtools` directory.
|
|||||||
* HS105
|
* HS105
|
||||||
* HS107
|
* HS107
|
||||||
* HS110
|
* HS110
|
||||||
|
* KP105
|
||||||
* KP115
|
* KP115
|
||||||
|
* KP401
|
||||||
|
|
||||||
### Power Strips
|
### Power Strips
|
||||||
|
|
||||||
|
* EP40
|
||||||
* HS300
|
* HS300
|
||||||
* KP303
|
* KP303
|
||||||
* KP400
|
* KP400
|
||||||
@ -135,11 +138,13 @@ or the `parse_pcap.py` script contained inside the `devtools` directory.
|
|||||||
|
|
||||||
### Bulbs
|
### Bulbs
|
||||||
|
|
||||||
|
* EP40
|
||||||
* LB100
|
* LB100
|
||||||
* LB110
|
* LB110
|
||||||
* LB120
|
* LB120
|
||||||
* LB130
|
* LB130
|
||||||
* LB230
|
* LB230
|
||||||
|
* KL50
|
||||||
* KL60
|
* KL60
|
||||||
* KL110
|
* KL110
|
||||||
* KL120
|
* KL120
|
||||||
|
25
devtools/check_readme_vs_fixtures.py
Normal file
25
devtools/check_readme_vs_fixtures.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
"""Script that checks if README.md is missing devices that have fixtures."""
|
||||||
|
from kasa.tests.conftest import ALL_DEVICES, BULBS, DIMMERS, LIGHT_STRIPS, PLUGS, STRIPS
|
||||||
|
|
||||||
|
readme = open("README.md").read()
|
||||||
|
|
||||||
|
typemap = {
|
||||||
|
"light strips": LIGHT_STRIPS,
|
||||||
|
"bulbs": BULBS,
|
||||||
|
"plugs": PLUGS,
|
||||||
|
"strips": STRIPS,
|
||||||
|
"dimmers": DIMMERS,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _get_device_type(dev, typemap):
|
||||||
|
for typename, devs in typemap.items():
|
||||||
|
if dev in devs:
|
||||||
|
return typename
|
||||||
|
else:
|
||||||
|
return "Unknown type"
|
||||||
|
|
||||||
|
|
||||||
|
for dev in ALL_DEVICES:
|
||||||
|
if dev not in readme:
|
||||||
|
print(f"{dev} not listed in {_get_device_type(dev, typemap)}")
|
Loading…
Reference in New Issue
Block a user