2024-02-19 17:01:31 +00:00
|
|
|
"""Implementation of device module."""
|
2024-04-16 18:21:20 +00:00
|
|
|
|
2024-02-19 17:01:31 +00:00
|
|
|
from typing import Dict
|
|
|
|
|
|
|
|
from ..smartmodule import SmartModule
|
|
|
|
|
|
|
|
|
|
|
|
class DeviceModule(SmartModule):
|
|
|
|
"""Implementation of device module."""
|
|
|
|
|
|
|
|
REQUIRED_COMPONENT = "device"
|
|
|
|
|
|
|
|
def query(self) -> Dict:
|
|
|
|
"""Query to execute during the update cycle."""
|
|
|
|
query = {
|
|
|
|
"get_device_info": None,
|
|
|
|
}
|
|
|
|
# Device usage is not available on older firmware versions
|
2024-02-24 01:16:43 +00:00
|
|
|
if self.supported_version >= 2:
|
2024-02-19 17:01:31 +00:00
|
|
|
query["get_device_usage"] = None
|
|
|
|
|
|
|
|
return query
|