Add LastAlertDetection module for smartcam devices (#1762)
Some checks failed
Stale / stale (push) Has been cancelled
CI / Perform Lint Checks (3.14) (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.14 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.14 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
CI / Python 3.14 on windows-latest (push) Has been cancelled

Add a `LastAlertDetection` module for SMARTCAM devices exposing `getLastAlarmInfo` as two `Info` sensor features:

- `last_alert_timestamp` — tz-aware `datetime` of the last alert, `None` when the device has never detected anything (`last_alarm_time` is `""` or `"0"` on such devices, and an unexpected value is also mapped to `None`
- `last_alert_type` — `LastAlertType` enum (`Motion`; `Unknown` fallback with a one-time warning per unknown raw value), `None` when unset.
This commit is contained in:
Julien Herr
2026-09-18 18:05:48 +02:00
committed by GitHub
parent 454e2697dc
commit b7b41f2c81
4 changed files with 231 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ from .childsetup import ChildSetup
from .device import DeviceModule
from .glassdetection import GlassDetection
from .homekit import HomeKit
from .lastalertdetection import LastAlertDetection
from .led import Led
from .lensmask import LensMask
from .linecrossingdetection import LineCrossingDetection
@@ -33,6 +34,7 @@ __all__ = [
"ChildSetup",
"DeviceModule",
"GlassDetection",
"LastAlertDetection",
"Led",
"LineCrossingDetection",
"MeowDetection",