Different devices and different firmwares report overheated status in
different ways.
Some devices indicate support for `overheat_protect` component, but
there are devices that report `overheat_status` even when it is not
listed.
Some other devices use `overheated` boolean that was already previously
supported, but this PR adds support for much more devices that use
`overheat_status` for reporting.
The "overheated" feature is moved into its own module, and uses either
of the ways to report this information.
This will also rename `REQUIRED_KEY_ON_PARENT` to `SYSINFO_LOOKUP_KEYS`
and change its logic to check if any of the keys in the list are found
in the sysinfo.
```
tpr@lumipyry ~/c/p/tests (fix/overheated)> ag 'overheat_protect' -c|wc -l
15
tpr@lumipyry ~/c/p/tests (fix/overheated)> ag 'overheated' -c|wc -l
38
tpr@lumipyry ~/c/p/tests (fix/overheated)> ag 'overheat_status' -c|wc -l
20
```
---------
Co-authored-by: Steven B. <51370195+sdb9696@users.noreply.github.com>
Add `on_discovered_raw` callback to Discover and adds a cli command `discover raw` which returns the raw json before serializing to a `DiscoveryResult` and attempting to create a device class.
Add LinkieTransportV2 transport used by kasa cameras and a basic
implementation for IOT.IPCAMERA (kasacam) devices.
---------
Co-authored-by: Zach Price <pricezt@ornl.gov>
Co-authored-by: Steven B <51370195+sdb9696@users.noreply.github.com>
Co-authored-by: Teemu Rytilahti <tpr@iki.fi>
This PR implements a clear-text, token-based transport protocol seen on
RV30 Plus (#937).
- Client sends `{"username": "email@example.com", "password":
md5(password)}` and gets back a token in the response
- Rest of the communications are done with POST at `/app?token=<token>`
---------
Co-authored-by: Steven B. <51370195+sdb9696@users.noreply.github.com>
Python 3.11 ships with latest Debian Bookworm.
pypy is not that widely used with this library based on statistics. It could be added back when pypy supports python 3.11.
Mashumaro is faster and doesn't come with all versioning problems that
pydantic does.
A basic perf test deserializing all of our discovery results fixtures
shows mashumaro as being about 6 times faster deserializing dicts than
pydantic. It's much faster parsing from a json string but that's likely
because it uses orjson under the hood although that's not really our use
case at the moment.
```
PYDANTIC - ms
=================
json dict
-----------------
4.7665 1.3268
3.1548 1.5922
3.1130 1.8039
4.2834 2.7606
2.0669 1.3757
2.0163 1.6377
3.1667 1.3561
4.1296 2.7297
2.0132 1.3471
4.0648 1.4105
MASHUMARO - ms
=================
json dict
-----------------
0.5977 0.5543
0.5336 0.2983
0.3955 0.2549
0.6516 0.2742
0.5386 0.2706
0.6678 0.2580
0.4120 0.2511
0.3836 0.2472
0.4020 0.2465
0.4268 0.2487
```