from typing import Optional, Any

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


class Sensor[Properties: Any](Core[Properties]):
  device: str  # Device ID

  name: Optional[str]
  type: Optional[str]

  state: Optional[State]
  status: Optional[Status]

  unit: Optional[str]  # for example: celsius, fahrenheit, etc.
  metric: Optional[str]  # for example: temperature, humidity, etc.


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


class SensorDto[Properties: Any](Dto[Properties]):
  device: str  # Device ID

  name: Optional[str]
  type: Optional[str]

  state: Optional[State]
  status: Optional[Status]

  unit: Optional[str]  # for example: celsius, fahrenheit, etc.
  metric: Optional[str]  # for example: temperature, humidity, etc.
