Skip to content

Releases

Version 1.2.0

Choose a tag to compare

@PolarBearEs PolarBearEs released this 06 Nov 10:58
8a4a4ae

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, a Literal of every registered component, so parse_component_payload keeps its per-component return types when the name isn't hard-coded.
  • Add EntityModel, the ComponentModel union without DeviceAutomation and Tag, so every member is a MqttEntityCommon with device, unique_id and the availability fields.
  • Export Payload, MqttModel, MqttBase, MqttReadOnly, MqttReadWrite, AvailabilityBase, AvailabilityConfig and DeviceDiscoveryPayload from ha_mqtt_models_pydantic; previously they could only be imported from components.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

Choose a tag to compare

@PolarBearEs PolarBearEs released this 30 Oct 20:30
f9441e9

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, InfraredEmitter and InfraredReceiver models, plus parse_infrared_payload to dispatch infrared payloads on their schema.
  • Add message_expiry_interval and visible_by_default to every entity, message_expiry_interval to device discovery payloads, stop_command_topic/stop_command_template to lawn mowers, and clean_segments_command_topic/clean_segments_command_template to 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 null where HA rejects it. Differential checks against HA 2026.10.4 found no payload HA accepts that these models reject.
  • Type parse_component_payload per component name, so parse_component_payload("sensor", ...) is inferred as Sensor. The union of all models is exported as ComponentModel.
  • 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

Choose a tag to compare

@PolarBearEs PolarBearEs released this 14 Mar 05:00

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

Choose a tag to compare

@PolarBearEs PolarBearEs released this 13 Mar 18:46

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, and template schemas.
  • 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, and 3.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.