Data Models¶
Backwards-compatibility re-export surface for pylocal_akuvox data models.
This package re-exports the ten public data-model classes from their
per-domain home modules so that existing
from pylocal_akuvox.models import <Name> imports continue to resolve
without source edits on the consumer side. For new code, importing directly
from the per-domain home (e.g. from pylocal_akuvox.models.users import
User) is also fine.
Cross-cutting types that are not specific to one domain (for example the
Capability enum and DeviceCapabilities dataclass introduced by
issue #123) belong as a sibling module at the package root — i.e.
pylocal_akuvox/capabilities.py — parallel to the existing service
modules, and explicitly NOT inside this models/ package. See spec
FR-009 and plan §R9.
- class pylocal_akuvox.models.AccessSchedule[source]¶
Bases:
objectTime-based access schedule stored on the device.
- classmethod from_api_response(data)[source]¶
Create AccessSchedule from API response data.
- Return type:
- Parameters:
- __init__(*, schedule_type, id=None, name=None, date_start=None, date_end=None, time_start=None, time_end=None, week=None, daily=None, display_id=None, source_type=None, mode=None, sun=None, mon=None, tue=None, wed=None, thur=None, fri=None, sat=None)¶
- Parameters:
schedule_type (str)
id (str | None)
name (str | None)
date_start (str | None)
date_end (str | None)
time_start (str | None)
time_end (str | None)
week (str | None)
daily (str | None)
display_id (str | None)
source_type (str | None)
mode (str | None)
sun (str | None)
mon (str | None)
tue (str | None)
wed (str | None)
thur (str | None)
fri (str | None)
sat (str | None)
- Return type:
None
- class pylocal_akuvox.models.CallLogEntry[source]¶
Bases:
objectRead-only record from the device call log.
- class pylocal_akuvox.models.Contact[source]¶
Bases:
objectContact entry in a door-phone or apartment-book address book.
Door-phone records populate
name, optionalid,phone, andgroup. Apartment-book records may omit a device-assignedIDand additionally exposeapt_name,apt_num,building, andlandline. The library does not synthesize a unique identifier for apartment-book records. Apartment-book-only fields are read-fidelity fields and are intentionally omitted fromto_api_payload().- classmethod from_api_response(data, *, capabilities=None)[source]¶
Create Contact from API response data.
capabilitiesis an optionalDeviceCapabilitiesrecord. When supplied, the parser consultscapabilities.schema_shapes.get("contact", SchemaShape.DOOR_PHONE)to choose between two parse paths:SchemaShape.DOOR_PHONE(default): today’s parser, byte-identical to the pre-refactor behaviour — requiresName(raisesAkuvoxParseErroron missingName); optionally consumesID,Phone,Group.SchemaShape.APARTMENT_BOOK: additive parser used by X915S current firmware.Nameis required as on door-phone;IDis not required (apartment-book payloads from the device may omit it). Apartment-book-only fields are surfaced asapt_name(APTName),apt_num(APTNum),building(Building), andlandline(Landline). Empty apartment-book strings are preserved as device-returned information.
Omitting the
capabilitieskwarg (or supplying a record with no"contact"schema-shape entry) falls back to the door-phone path — preserving FR-016 for legacy callers.- Return type:
- Parameters:
capabilities (DeviceCapabilities | None)
- class pylocal_akuvox.models.DeviceConfig[source]¶
Bases:
objectFull device configuration from /api/config/get.
Wraps all autop-format key-value pairs returned by the device. Provides dict-like read access to any configuration key.
- classmethod from_api_response(data)[source]¶
Create DeviceConfig from API response data.
- Return type:
- Parameters:
- class pylocal_akuvox.models.DeviceInfo[source]¶
Bases:
objectRead-only device identification data.
- class pylocal_akuvox.models.DeviceStatus[source]¶
Bases:
objectPoint-in-time device operational status.
- class pylocal_akuvox.models.DoorLogEntry[source]¶
Bases:
objectRead-only record from the device door access log.
- class pylocal_akuvox.models.Group[source]¶
Bases:
objectOrganizational group stored on the device.
- class pylocal_akuvox.models.Relay[source]¶
Bases:
objectControllable relay on the device.
- class pylocal_akuvox.models.User[source]¶
Bases:
objectLocal user account stored on the device.
- classmethod from_api_response(data, *, capabilities=None)[source]¶
Create User from API response data.
capabilitiesis an optionalDeviceCapabilitiesrecord. When supplied, the parser consultscapabilities.field_aliases.get("schedule_relay")to find the schedule-relay field, walking each name inFieldAliases.readin declared order and using the first match. When omitted (or when the record has no"schedule_relay"entry), the parser falls back to the canonicalschedule_relaychain:FieldAliases( read=("ScheduleRelay", "Schedule-Relay", "Schedule"), write=("ScheduleRelay", "Schedule-Relay"), )
byte-identical to the pre-refactor hardcoded chain — preserving FR-016 (no externally observable change for default callers).
- Return type:
- Parameters:
capabilities (DeviceCapabilities | None)
- __init__(*, name, user_id, schedule_relay, id=None, web_relay=None, private_pin=None, card_code=None, lift_floor_num=None, user_type=None, source=None, source_type=None)¶