mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-23 11:43:34 +00:00
21 lines
565 B
Python
21 lines
565 B
Python
|
"""Implementation of the emeter module."""
|
||
|
from ..emeterstatus import EmeterStatus
|
||
|
from .usage import Usage
|
||
|
|
||
|
|
||
|
class Emeter(Usage):
|
||
|
"""Emeter module."""
|
||
|
|
||
|
def query(self):
|
||
|
"""Prepare query for emeter data."""
|
||
|
return self._device._create_emeter_request()
|
||
|
|
||
|
@property # type: ignore
|
||
|
def realtime(self) -> EmeterStatus:
|
||
|
"""Return current energy readings."""
|
||
|
return EmeterStatus(self.data["get_realtime"])
|
||
|
|
||
|
async def erase_stats(self):
|
||
|
"""Erase all stats."""
|
||
|
return await self.call("erase_emeter_stat")
|