Models¶
Pydantic data models used across zigporter.
Pydantic data models shared across zigporter.
All models use Pydantic v2. They are used for serialising ZHA export snapshots, tracking migration state, and reporting pre-flight check results.
AutomationRef
¶
Bases: BaseModel
A Home Assistant automation that references one or more ZHA entities.
Collected during export so the migrate wizard can update entity IDs inside automation configs after a device has been re-paired with Z2M.
| ATTRIBUTE | DESCRIPTION |
|---|---|
automation_id |
Internal HA automation ID (e.g.
TYPE:
|
alias |
Human-readable name shown in the HA UI.
TYPE:
|
entity_references |
Entity IDs from this device that appear in the automation.
TYPE:
|
CheckResult
¶
Bases: BaseModel
Result of a single pre-flight connectivity or configuration check.
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
Short human-readable check name (e.g.
TYPE:
|
status |
Outcome of the check.
TYPE:
|
message |
Detail message shown to the user.
TYPE:
|
blocking |
If
TYPE:
|
CheckStatus
¶
Bases: str, Enum
Result severity for a single pre-flight check.
| ATTRIBUTE | DESCRIPTION |
|---|---|
OK |
Check passed with no issues.
|
FAILED |
Check failed; the operation should be blocked if
|
WARNING |
Check raised a concern but does not block the operation.
|
SKIPPED |
Check was intentionally not run (e.g. missing optional config).
|
ZHADevice
¶
Bases: BaseModel
A ZHA device as exported from Home Assistant.
Represents the complete state of a Zigbee device at export time, including its entities, area assignment, and any automations that reference it.
| ATTRIBUTE | DESCRIPTION |
|---|---|
device_id |
HA device registry ID (UUID string).
TYPE:
|
ieee |
IEEE 802.15.4 address in colon-separated hex (e.g.
TYPE:
|
name |
Integration-assigned device name.
TYPE:
|
name_by_user |
User-customised label shown in the HA UI.
TYPE:
|
manufacturer |
Device manufacturer as reported by the Zigbee coordinator.
TYPE:
|
model |
Device model string.
TYPE:
|
area_id |
HA area registry ID, if the device is assigned to a room.
TYPE:
|
area_name |
Human-readable area name corresponding to
TYPE:
|
device_type |
Zigbee device role:
TYPE:
|
quirk_applied |
TYPE:
|
quirk_class |
Fully-qualified Python class name of the applied quirk.
TYPE:
|
entities |
All entities registered to this device.
TYPE:
|
automations |
Automations that reference at least one entity of this device.
TYPE:
|
ZHAEntity
¶
Bases: BaseModel
A single entity belonging to a ZHA device.
| ATTRIBUTE | DESCRIPTION |
|---|---|
entity_id |
HA entity ID (e.g.
TYPE:
|
name |
Integration-assigned name.
TYPE:
|
name_by_user |
User-customised label, overrides
TYPE:
|
platform |
Integration platform (always
TYPE:
|
unique_id |
Stable identifier used by HA to track the entity across renames.
TYPE:
|
device_class |
HA device class (e.g.
TYPE:
|
disabled |
TYPE:
|
state |
Last-known state string at export time (e.g.
TYPE:
|
attributes |
Full state attributes dict at export time.
TYPE:
|
ZHAExport
¶
Bases: BaseModel
Top-level container for a ZHA device inventory snapshot.
Written to ~/.config/zigporter/zha-export.json by zigporter export
and read back by zigporter migrate.
| ATTRIBUTE | DESCRIPTION |
|---|---|
exported_at |
UTC timestamp when the export was created.
TYPE:
|
ha_url |
HA base URL used during the export (e.g.
TYPE:
|
devices |
All ZHA devices found in the HA registry at export time.
TYPE:
|