models.py 371 B

123456789101112131415161718
  1. """Library to handle connection with Switchbot."""
  2. from __future__ import annotations
  3. from dataclasses import dataclass
  4. from typing import Any
  5. from bleak.backends.device import BLEDevice
  6. @dataclass
  7. class SwitchBotAdvertisement:
  8. """Switchbot advertisement."""
  9. address: str
  10. data: dict[str, Any]
  11. device: BLEDevice
  12. rssi: int
  13. active: bool = False