- Full resource map discovered via live CoAP-DTLS session against ARTIK051_REF_17K fridge-freezer (firmware DA-REF-ART-COMMON-1_20201124) - seed_path: /device/0 (returns 32 links including hidden appliance resources) - Entities: fridge/freezer temp + setpoints, 3x door sensors (fridge, freezer, convertible zone), power (W), energy (kWh, total_increasing), water filter usage/status, ice maker, rapid fridge/freeze, sabbath mode - Port: 49155 (not 49154) First known public documentation of this firmware's local CoAP-DTLS resource layout.
35 lines
943 B
Python
35 lines
943 B
Python
"""Appliance descriptors registry.
|
|
|
|
Adding a new appliance class:
|
|
1. Write `appliances/<class>.py` with an ApplianceDescriptor named
|
|
after the class (uppercase, e.g. OVEN).
|
|
2. Add it to DESCRIPTORS below.
|
|
3. Set DEVICE_CLASS=<class> in the per-device .env.
|
|
|
|
main.py imports get_descriptor(name) to look up the descriptor at
|
|
startup; the bridge itself stays class-agnostic.
|
|
"""
|
|
from .base import ApplianceDescriptor
|
|
from .dryer import DRYER
|
|
from .oven import OVEN
|
|
from .fridge import FRIDGE
|
|
|
|
|
|
DESCRIPTORS: dict[str, ApplianceDescriptor] = {
|
|
DRYER.name: DRYER,
|
|
OVEN.name: OVEN,
|
|
FRIDGE.name: FRIDGE,
|
|
}
|
|
|
|
|
|
def get_descriptor(name: str) -> ApplianceDescriptor:
|
|
try:
|
|
return DESCRIPTORS[name]
|
|
except KeyError:
|
|
raise ValueError(
|
|
f"unknown DEVICE_CLASS={name!r}; "
|
|
f"available: {sorted(DESCRIPTORS)}") from None
|
|
|
|
|
|
__all__ = ['ApplianceDescriptor', 'DESCRIPTORS', 'get_descriptor']
|