mirror of
https://github.com/home-assistant/core.git
synced 2026-05-31 12:44:04 +01:00
d89bcd83d9
Co-authored-by: Erik Montnemery <erik@montnemery.com>
29 lines
633 B
Python
29 lines
633 B
Python
"""Helper for Netatmo integration."""
|
|
|
|
from dataclasses import dataclass
|
|
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 = uuid4()
|