Add Baby Tracker client and Home Assistant integration
Python client for the Baby Tracker sync server, reverse engineered from the Android app (4.53), and a HACS-installable Home Assistant integration built on it. Each baby gets a log calendar and summary sensors, and actions add entries that sync back to the group. Reading has been run against the real server. Uploading and running inside real Home Assistant have not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
6466f002e0
51 files changed
+5199
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,24 @@
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
from ...exceptions import HomeAssistantError
|
||||
|
||||
|
||||
@dataclass
|
||||
class CalendarEvent:
|
||||
start: datetime
|
||||
end: datetime
|
||||
summary: str
|
||||
description: Optional[str] = None
|
||||
uid: Optional[str] = None
|
||||
|
||||
def __post_init__(self):
|
||||
if self.start.tzinfo is None or self.end.tzinfo is None:
|
||||
raise HomeAssistantError("Expected all values to have a timezone")
|
||||
if self.end <= self.start:
|
||||
raise HomeAssistantError("Expected end time to be after start time")
|
||||
|
||||
|
||||
class CalendarEntity:
|
||||
pass
|
||||
@@ -0,0 +1,30 @@
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum
|
||||
from typing import Any, Optional
|
||||
|
||||
|
||||
class SensorDeviceClass(str, Enum):
|
||||
DISTANCE = "distance"
|
||||
DURATION = "duration"
|
||||
TEMPERATURE = "temperature"
|
||||
TIMESTAMP = "timestamp"
|
||||
VOLUME = "volume"
|
||||
WEIGHT = "weight"
|
||||
|
||||
|
||||
class SensorStateClass(str, Enum):
|
||||
MEASUREMENT = "measurement"
|
||||
TOTAL_INCREASING = "total_increasing"
|
||||
|
||||
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class SensorEntityDescription:
|
||||
key: str
|
||||
device_class: Optional[SensorDeviceClass] = None
|
||||
state_class: Optional[SensorStateClass] = None
|
||||
native_unit_of_measurement: Optional[Any] = None
|
||||
suggested_display_precision: Optional[int] = None
|
||||
|
||||
|
||||
class SensorEntity:
|
||||
pass
|
||||
Reference in new issue
Block a user