Repository navigation
Releases
Releases · PolarBearEs/ha_mqtt_models_pydantic
Version 1.2.0
ha-mqtt-models-pydantic v1.2.0
Adds typing helpers for code that handles components generically and exports the shared base models from the package root. Nothing existing changes.
Highlights
- Add
ComponentName, aLiteralof every registered component, soparse_component_payloadkeeps its per-component return types when the name isn't hard-coded. - Add
EntityModel, theComponentModelunion withoutDeviceAutomationandTag, so every member is aMqttEntityCommonwithdevice,unique_idand the availability fields. - Export
Payload,MqttModel,MqttBase,MqttReadOnly,MqttReadWrite,AvailabilityBase,AvailabilityConfigandDeviceDiscoveryPayloadfromha_mqtt_models_pydantic; previously they could only be imported fromcomponents.common.
What's Changed
- Export ComponentName, EntityModel and the base models by @PolarBearEs in #5
Full Changelog: v1.1.0...v1.2.0
Version 1.1.0
ha-mqtt-models-pydantic v1.1.0
Syncs the models with the MQTT discovery schemas of Home Assistant core 2026.10.4, adds the new date, time, datetime and infrared platforms, and makes parse_component_payload return the concrete model type for each component.
Highlights
- Add
Date,Time,DateTime,InfraredEmitterandInfraredReceivermodels, plusparse_infrared_payloadto dispatch infrared payloads on theirschema. - Add
message_expiry_intervalandvisible_by_defaultto every entity,message_expiry_intervalto device discovery payloads,stop_command_topic/stop_command_templateto lawn mowers, andclean_segments_command_topic/clean_segments_command_templateto vacuums. - Validate the new fields the way Home Assistant does: HA boolean strings, time-period dicts converted to seconds, publish and subscribe topic rules, and rejection of an explicit
nullwhere HA rejects it. Differential checks against HA 2026.10.4 found no payload HA accepts that these models reject. - Type
parse_component_payloadper component name, soparse_component_payload("sensor", ...)is inferred asSensor. The union of all models is exported asComponentModel. - Expose the synced Home Assistant release as
HA_CORE_VERSION. - Publish with complete PyPI metadata and an MIT
LICENSE. Releases now check that the tag matches the project version and run the full test suite before uploading.
What's Changed
- Sync MQTT models with Home Assistant 2026.10 by @PolarBearEs in #2
- Harden the release workflow and fill in package metadata by @PolarBearEs in #4
- Type parse_component_payload return by component name by @PolarBearEs in #3
Full Changelog: v1.0.1...v1.1.0
Version 1.0.1
What's Changed
- Make defaulted scalar MQTT fields non-optional by @PolarBearEs in #1
Full Changelog: v1.0.0...v1.0.1
Version 1.0.0
First public release of ha-mqtt-models-pydantic, a typed Pydantic v2 library for validating Home Assistant MQTT discovery payloads.
Includes
- Pydantic models for a broad set of Home Assistant MQTT discovery components.
- Discovery parsing helpers:
parse_component_payload()parse_light_payload()parse_device_discovery_payload()
- Support for Home Assistant MQTT discovery abbreviations.
- Separate light payload models for
basic,json, andtemplateschemas. - Shared models for MQTT entity metadata, device info, and origin info.
- Type information for downstream type checkers via
py.typed.
Compatibility
- Python
3.11+ - Tested in CI on Python
3.11,3.12,3.13, and3.14
Validation Behavior
- Home Assistant-style coercion for string-like discovery fields where HA accepts scalar inputs.
- Regression coverage for real-world Z-Wave MQTT discovery payloads.
- Discovery-focused test coverage, linting, and strict type checking.
Packaging and Automation
- Hatchling-based build configuration.
- GitHub Actions CI for linting, formatting, type checking, and tests.
- GitHub release workflow for publishing distributions to PyPI.