Skip to content

v0.30.0

Choose a tag to compare

@nodejsmith-release-please nodejsmith-release-please released this 10 May 23:57
7b56083

Breaking Changes

  • Field type narrowing (StrEnum) — Fields previously typed as str are now typed with their domain StrEnum. StrEnums accept string construction so state.attributes.hvac_mode == "heat" still works, but type checkers will flag comparisons against raw strings. Affected fields: ClimateAttributes.hvac_action, hvac_mode, hvac_modes; LightAttributes.color_mode, supported_color_modes. (#716)
  • Field type changes (runtime)MediaPlayerAttributes.media_position_updated_at: str | NoneZonedDateTime | None (validator now parses the ISO string). ClimateAttributes.current_temperature: int | float | Nonefloat | None. (#716)
  • Removed deprecated fields — Fields typed as None in HA source (deprecated) are no longer declared on the model. Values still land in model_extra (accessible via .extra("field_name")): LightAttributes.color_temp, max_mireds, min_mireds, xy_color; MediaPlayerAttributes.entity_picture_local. (#716)
  • Removed constraintsLightAttributes.brightness no longer has gt=-1, lt=256 field validators. (#716)
  • hassette.models.states.features deleted — IntFlag enums moved to per-domain files. All enums are still re-exported from hassette.models.states so from hassette.models.states import LightEntityFeature continues to work. (#716)

State Models

  • State model attributes are now code-generated from Home Assistant core source via AST analysis, replacing the previous hand-maintained models. 34 entity domains have generated state models with proper @field_validator for ZonedDateTime wire conversion, StrEnum attribute types, and supports_* boolean properties. (#716)
  • The codegen pipeline includes a CI freshness check — if the pinned HA version falls behind, CI warns so models stay aligned with upstream. (#716)