python-kasa/kasa
Teemu R 836f1701b9
Optimize I/O access (#59)
* Optimize I/O access

A single update() will now fetch information from all interesting modules,
including the current device state and the emeter information.

In practice, this will allow dropping the number of I/O reqs per homeassistant update cycle to 1,
which is paramount at least for bulbs which are very picky about sequential accesses.
This can be further extend to other modules/methods, if needed.

Currently fetched data:
* sysinfo
* realtime, today's and this months emeter stats

New properties:
* emeter_realtime: return the most recent emeter information, update()-version of get_emeter_realtime()
* emeter_today: returning today's energy consumption
* emeter_this_month: same for this month

Other changes:
* Accessing @requires_update properties will cause SmartDeviceException if the device has not ever been update()d
* Fix __repr__ for devices that haven't been updated
* Smartbulb uses now the state data from get_sysinfo instead of separately querying the bulb service
* SmartStrip's state_information no longer lists onsince for separate plugs
* The above mentioned properties are now printed out by cli
* Simplify is_on handling for bulbs

* remove implicit updates, return device responses for actions, update README.md instructions. fixes #61
2020-05-24 17:57:54 +02:00
..
tests Optimize I/O access (#59) 2020-05-24 17:57:54 +02:00
__init__.py Convert to use poetry & pyproject.toml for dep & build management (#54) 2020-05-12 12:11:47 +02:00
cli.py Optimize I/O access (#59) 2020-05-24 17:57:54 +02:00
discover.py Improve dimmer support (#62) 2020-05-20 21:17:33 +02:00
protocol.py async++, small powerstrip improvements (#46) 2020-04-21 20:46:13 +02:00
smartbulb.py Optimize I/O access (#59) 2020-05-24 17:57:54 +02:00
smartdevice.py Optimize I/O access (#59) 2020-05-24 17:57:54 +02:00
smartdimmer.py Optimize I/O access (#59) 2020-05-24 17:57:54 +02:00
smartplug.py Optimize I/O access (#59) 2020-05-24 17:57:54 +02:00
smartstrip.py Optimize I/O access (#59) 2020-05-24 17:57:54 +02:00