from typing import Optional, List, Any

from ....core.enums.state import State
from ....core.interfaces.dto import Dto
from ....core.interfaces.core import Core


class Metric[Properties: Any](Core[Properties]):
  sensor: str  # Sensor ID

  key: Optional[str]

  state: Optional[State]
  device: Optional[str]  # Device ID

  value: float | List[float]


# ----------------------------------------
# Data Transfer Object Interface
# ----------------------------------------


class MetricDto[Properties: Any](Dto[Properties]):
  sensor: str  # Sensor ID

  key: Optional[str]

  state: Optional[State]
  device: Optional[str]  # Device ID

  value: float | List[float]
