1
0
mirror of https://github.com/home-assistant/core.git synced 2026-07-01 11:46:40 +01:00
Files
core/homeassistant/components/netatmo/helper.py
T
Joost Lekkerkerker 55af1c3b3c Enable RUF009 (#172738)
2026-06-01 14:17:00 +02:00

29 lines
661 B
Python

"""Helper for Netatmo integration."""
from dataclasses import dataclass, field
from uuid import UUID, uuid4
from pyatmo.modules.device_types import DeviceType as NetatmoDeviceType
def device_type_to_str(device_type: NetatmoDeviceType) -> str:
"""Convert a device type to a string.
Used to generate backwards compatible unique ids.
"""
return f"{type(device_type).__name__}.{device_type}"
@dataclass
class NetatmoArea:
"""Class for keeping track of an area."""
area_name: str
lat_ne: float
lon_ne: float
lat_sw: float
lon_sw: float
mode: str
show_on_map: bool
uuid: UUID = field(default_factory=uuid4)