Skip to content

Releases: NodeJSmith/hassette

v0.19.1

26 Jan 04:59
413e990

Choose a tag to compare

[0.19.1] - 2026-01-25

Fixed

  • Update state_manager.pyi to fix type hints

Full Changelog: v0.19.0...v0.19.1

v0.19.0

26 Jan 04:42
6edee36

Choose a tag to compare

[0.19.0] - 2026-01-25

Fixed

  • Exit TypeRegistry.convert early if already a valid type
  • Avoid mutating state dicts when accessing via DomainStates

Added

  • Add __contains__ method to DomainStates
    • Allows us to use in checks
  • Add to_dict, keys, values, and items methods to DomainStates
    • Provides convenient access to entity IDs and typed states
  • Add yield_domain_states to StateProxy
    • Allows iterating over all states in the proxy
    • Handles KeyError when extracting domain
  • Update DomainStates class to accept a StateProxy instance instead of state dictionary to ensure it stays up to date
  • Add caching to StateManager, holding on to each DomainStates instance after creation
  • Add caching to DomainStates, using frozendict.deepfreeze to hash the state dict and avoid recreating the instance if it has not changed

Removed

  • BREAKING: Remove _TypedStateGetter class and corresponding get method on StateManager - this was never a good idea due to its confusing api
  • BREAKING: Remove all property on StateManager - this is to avoid calculating all states unnecessarily

Full Changelog: v0.18.1...v0.19.0

v0.18.1

14 Dec 04:25
3392035

Choose a tag to compare

[0.18.1] - 2025-12-13

Changed

  • Improve docker startup script and dependency handling
  • Rewrite docker docs to be more clear about project structure and dependency installation

Fixed

  • Fixed a bug in autodetect apps exclusion directories
    • Previous commit had mapped the exclusion dirs to Path objects, which broke the set comparison, this has been reverted

[0.18.0.dev3] - 2025-12-13

Changed

  • Hardcode UID/GID of 1000 for non-root user in Docker image

[0.18.0.dev2] - 2025-12-13

Changed

  • Breaking: Docker image switched to Debian slim
  • Breaking: Remove latest tag, latest tag will now include python version as well

Fixed

  • Use correct version of python when pulling base image
    • (e.g. image tagged with py-3.12 uses python 3.12)

[0.18.0.dev1] - 2025-12-13

Changed

  • Allow Python 3.11 and 3.12 again!
  • Breaking: All events now contain untyped payloads instead of typed ones
    • StateChangeEvent is now RawStateChangeEvent
    • There is a new DI handler for TypedStateChangeEvent to handle conversion if desired
  • Breaking: State conversion system now uses dynamic registry instead of hardcoded unions
    • StateUnion type has been removed - use BaseState in type hints instead
    • DomainLiteral type has been removed - no longer needed with dynamic registration
    • State classes automatically register their domains via __init_subclass__ hook
  • Breaking: try_convert_state now typed to return BaseState | None instead of StateUnion | None
    • Uses registry lookup instead of Pydantic discriminated unions for conversion
    • Falls back to BaseState for unknown/custom domains
    • try_convert_state moved to hassette.state_registry module
    • states.__init__ now only imports/exports classes, no conversion logic
  • Improved dependency injection system for event handlers, including support for optional dependencies via Maybe* annotations
  • Renamed states.py to state_manager.py (and renamed the class) to avoid confusion with models/states module
  • Removed defaults from StateT and StateValueT type vars
  • Removed type constraints from StateValueT type var to allow custom types to be used
  • Moved accessors, conditions, dependencies, and predicates all to hassette.event_handling for consistency
  • Moved DI extraction and injection modules to hassette.bus

Added

  • TypeRegistry class for handling simple value conversion (e.g. converting "off" to False)
  • Handling of Union types
  • Handling of None types
  • Handling of type conversion for custom Annotated DI handlers

Removed

  • Breaking: Removed StateUnion type - replaced with BaseState throughout codebase
  • Breaking: Removed DomainLiteral type - no longer needed with registry system
  • Breaking: Removed manual _StateUnion type definition from states module
  • Breaking: Removed StateValueOld/New, StateValueOldNew, StateOldNew, MaybeStateOldNew, AttrOld, AttrNew, AttrOldNew DI handlers
    • These can be used still by annotating with Annotated[<type>, A.<function>] using provided accessors module
    • They were too difficult to maintain/type properly across the framework

Full Changelog: v0.17.0...v0.18.1

v0.18.0.dev3

13 Dec 19:55
30f6c6f

Choose a tag to compare

v0.18.0.dev3 Pre-release
Pre-release

[0.18.0.dev3] - 2025-12-13

Changed

  • Hardcode UID/GID of 1000 for non-root user in Docker image

Full Changelog: v0.18.0.dev2...v0.18.0.dev3

v0.18.0.dev2

13 Dec 19:26
607ccfe

Choose a tag to compare

v0.18.0.dev2 Pre-release
Pre-release

[0.18.0.dev2] - 2025-12-13

Changed

  • Breaking: Docker image switched to Debian slim
  • Breaking: Remove latest tag, latest tag will now include python version as well

Full Changelog: v0.18.0.dev1...v0.18.0.dev2

v0.18.0.dev1

13 Dec 18:00
7628d1c

Choose a tag to compare

v0.18.0.dev1 Pre-release
Pre-release

[0.18.0.dev1] - 2025-12-13

Changed

  • Allow Python 3.11 and 3.12 again!
  • Breaking: All events now contain untyped payloads instead of typed ones
    • StateChangeEvent is now RawStateChangeEvent
    • There is a new DI handler for TypedStateChangeEvent to handle conversion if desired
  • Breaking: State conversion system now uses dynamic registry instead of hardcoded unions
    • StateUnion type has been removed - use BaseState in type hints instead
    • DomainLiteral type has been removed - no longer needed with dynamic registration
    • State classes automatically register their domains via __init_subclass__ hook
  • Breaking: try_convert_state now typed to return BaseState | None instead of StateUnion | None
    • Uses registry lookup instead of Pydantic discriminated unions for conversion
    • Falls back to BaseState for unknown/custom domains
    • try_convert_state moved to hassette.state_registry module
    • states.__init__ now only imports/exports classes, no conversion logic
  • Improved dependency injection system for event handlers, including support for optional dependencies via Maybe* annotations
  • Renamed states.py to state_manager.py (and renamed the class) to avoid confusion with models/states module
  • Removed defaults from StateT and StateValueT type vars
  • Removed type constraints from StateValueT type var to allow custom types to be used
  • Moved accessors, conditions, dependencies, and predicates all to hassette.event_handling for consistency
  • Moved DI extraction and injection modules to hassette.bus

Added

  • TypeRegistry class for handling simple value conversion (e.g. converting "off" to False)
  • Handling of Union types
  • Handling of None types
  • Handling of type conversion for custom Annotated DI handlers

Removed

  • Breaking: Removed StateUnion type - replaced with BaseState throughout codebase
  • Breaking: Removed DomainLiteral type - no longer needed with registry system
  • Breaking: Removed manual _StateUnion type definition from states module
  • Breaking: Removed StateValueOld/New, StateValueOldNew, StateOldNew, MaybeStateOldNew, AttrOld, AttrNew, AttrOldNew DI handlers
    • These can be used still by annotating with Annotated[<type>, A.<function>] using provided accessors module
    • They were too difficult to maintain/type properly across the framework

Full Changelog: v0.17.0...v0.18.0.dev1

v0.17.0

23 Nov 06:15
3e29b77

Choose a tag to compare

[0.17.0] - 2025-11-22

Changed

  • Breaking: - Requires Python 3.13 going forward, Python 3.12 and 3.11 are no longer supported.
    • This allows use of type, defaults for TypeVars, and other new typing features.
  • Renamed core_config.py to core.py
  • Renamed services to core and move core.py under core directory
    • Didn't make sense to keep named as services since we have resources in here as well

Added

  • Add diskcache dependency and cache attribute to all resources
    • Each resource class has its own cache directory under the Hassette data directory
  • Add states attribute to App - provides access to current states in Home Assistant
    • states is an instance of the new States class
    • States provides domain-based access to entity states, e.g. app.states.light.get("light.my_light")
    • States listens to state change events and keeps an up-to-date cache of states
    • New states documentation page under core-concepts
  • Add Maybe* DI annotations for optional dependencies in event handlers
    • MaybeStateNew, MaybeStateOld, MaybeEntityId, etc.
    • These will allow None or MISSING_VALUE to be returned if the value is not available
    • The original dependency annotations will raise an error if the value is not available
  • Add raise_on_incorrect_dependency_type to HassetteConfig to control whether to raise an error if a dependency cannot be provided due to type mismatch
    • Default is true in production mode, false in dev mode
    • When false a warning will be logged but the handler will still be called with whatever value was returned

Fixed

  • Fixed bug that caused apps to not be re-imported when code changed due to skipping cache check in app handler
  • Fixed missing domains in DomainLiteral in hassette.models.states.base
    • Add tests to catch this in the future

Full Changelog: v0.16.0...v0.17.0

v0.16.0

17 Nov 04:26
27fd6a3

Choose a tag to compare

[0.16.0] - 2025-11-16

Added

  • Added ANY_VALUE sentinel for clearer semantics in predicates - use this to indicate "any value is acceptable"
  • Dependency Injection for Event Handlers - Handlers can now use Annotated type hints with dependency markers from hassette.dependencies to automatically extract and inject event data as parameters. This provides a cleaner, more type-safe alternative to manually accessing event payloads.
    • Available dependencies include StateNew, StateOld, AttrNew(name), AttrOld(name), EntityId, Domain, Service, ServiceData, StateValueNew, StateValueOld, EventContext, and more
    • Handlers can mix DI parameters with custom kwargs
    • See hassette.dependencies module documentation and updated examples for details

Changed

  • Breaking: - Event handlers can no longer receive positional only args or variadic positional args
  • NOT_PROVIDED predicate is now used only to indicate that a parameter was not provided to a function

Full Changelog: v0.15.5...v0.16.0

v0.15.5

14 Nov 23:45
51fb5cd

Choose a tag to compare

[0.15.5] - 2025-11-14

Changed

  • Update HassetteConfig defaults to differ if in dev mode
    • Generally speaking, values are extended (e.g. timeouts) and more permissive (e.g. allow_startup_if_app_precheck_fails = true in dev mode)
  • Moved AppManifest and HassetteTomlConfigSettingsSource to classes.py
  • Moved LOG_LEVELS to hassette.types.types instead of const.misc, as this is a Literal, not a list of constants
  • Renamed core_config.py to core.py
  • Bumped version of uv in mise.toml, docker image, and build backend
  • Converted docs to mkdocs instead of sphinx

Fixed

  • Fixed bug in AppHandler where all apps would be lost when handle_changes was called, due to improper reloading of configuration
    • Now uses HassetteConfig.reload() to reload config instead of re-initializing the class

Full Changelog: v0.15.4...v0.15.5

v0.15.4

07 Nov 22:00
5375f2d

Choose a tag to compare

[0.15.4] - 2025-11-07

Added

  • add config setting for continuing startup if app precheck fails
  • add config setting for skipping app precheck entirely
  • add config setting for loading found .env files into os.environ
  • add entities back to public API exports from hassette

Changed

  • Cache app import failures to avoid attempting to load these again if we are continuing startup after precheck failures
  • Improve app precheck logging by using logger.error and short traceback instead of logger.exception

Full Changelog: v0.15.3...v0.15.4