Releases: NodeJSmith/hassette
Releases · NodeJSmith/hassette
v0.19.1
[0.19.1] - 2026-01-25
Fixed
- Update
state_manager.pyito fix type hints
Full Changelog: v0.19.0...v0.19.1
v0.19.0
[0.19.0] - 2026-01-25
Fixed
- Exit
TypeRegistry.convertearly if already a valid type - Avoid mutating state dicts when accessing via
DomainStates
Added
- Add
__contains__method to DomainStates- Allows us to use
inchecks
- Allows us to use
- Add
to_dict,keys,values, anditemsmethods to DomainStates- Provides convenient access to entity IDs and typed states
- Add
yield_domain_statesto StateProxy- Allows iterating over all states in the proxy
- Handles KeyError when extracting domain
- Update
DomainStatesclass to accept aStateProxyinstance instead of state dictionary to ensure it stays up to date - Add caching to
StateManager, holding on to eachDomainStatesinstance after creation - Add caching to
DomainStates, usingfrozendict.deepfreezeto hash the state dict and avoid recreating the instance if it has not changed
Removed
- BREAKING: Remove
_TypedStateGetterclass and correspondinggetmethod onStateManager- this was never a good idea due to its confusing api - BREAKING: Remove
allproperty onStateManager- this is to avoid calculating all states unnecessarily
Full Changelog: v0.18.1...v0.19.0
v0.18.1
[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
latesttag, 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
StateChangeEventis nowRawStateChangeEvent- There is a new DI handler for
TypedStateChangeEventto handle conversion if desired
- Breaking: State conversion system now uses dynamic registry instead of hardcoded unions
StateUniontype has been removed - useBaseStatein type hints insteadDomainLiteraltype has been removed - no longer needed with dynamic registration- State classes automatically register their domains via
__init_subclass__hook
- Breaking:
try_convert_statenow typed to returnBaseState | Noneinstead ofStateUnion | None- Uses registry lookup instead of Pydantic discriminated unions for conversion
- Falls back to
BaseStatefor unknown/custom domains try_convert_statemoved tohassette.state_registrymodulestates.__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.pytostate_manager.py(and renamed the class) to avoid confusion withmodels/statesmodule - 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, andpredicatesall tohassette.event_handlingfor consistency - Moved DI extraction and injection modules to
hassette.bus
Added
TypeRegistryclass 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
AnnotatedDI handlers
Removed
- Breaking: Removed
StateUniontype - replaced withBaseStatethroughout codebase - Breaking: Removed
DomainLiteraltype - no longer needed with registry system - Breaking: Removed manual
_StateUniontype 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 providedaccessorsmodule - They were too difficult to maintain/type properly across the framework
- These can be used still by annotating with
Full Changelog: v0.17.0...v0.18.1
v0.18.0.dev3
[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
[0.18.0.dev2] - 2025-12-13
Changed
- Breaking: Docker image switched to Debian slim
- Breaking: Remove
latesttag, latest tag will now include python version as well
Full Changelog: v0.18.0.dev1...v0.18.0.dev2
v0.18.0.dev1
[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
StateChangeEventis nowRawStateChangeEvent- There is a new DI handler for
TypedStateChangeEventto handle conversion if desired
- Breaking: State conversion system now uses dynamic registry instead of hardcoded unions
StateUniontype has been removed - useBaseStatein type hints insteadDomainLiteraltype has been removed - no longer needed with dynamic registration- State classes automatically register their domains via
__init_subclass__hook
- Breaking:
try_convert_statenow typed to returnBaseState | Noneinstead ofStateUnion | None- Uses registry lookup instead of Pydantic discriminated unions for conversion
- Falls back to
BaseStatefor unknown/custom domains try_convert_statemoved tohassette.state_registrymodulestates.__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.pytostate_manager.py(and renamed the class) to avoid confusion withmodels/statesmodule - 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, andpredicatesall tohassette.event_handlingfor consistency - Moved DI extraction and injection modules to
hassette.bus
Added
TypeRegistryclass 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
AnnotatedDI handlers
Removed
- Breaking: Removed
StateUniontype - replaced withBaseStatethroughout codebase - Breaking: Removed
DomainLiteraltype - no longer needed with registry system - Breaking: Removed manual
_StateUniontype 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 providedaccessorsmodule - They were too difficult to maintain/type properly across the framework
- These can be used still by annotating with
Full Changelog: v0.17.0...v0.18.0.dev1
v0.17.0
[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.
- This allows use of
- Renamed
core_config.pytocore.py - Renamed
servicestocoreand movecore.pyundercoredirectory- Didn't make sense to keep named as
servicessince we have resources in here as well
- Didn't make sense to keep named as
Added
- Add
diskcachedependency andcacheattribute to all resources- Each resource class has its own cache directory under the Hassette data directory
- Add
statesattribute toApp- provides access to current states in Home Assistantstatesis an instance of the newStatesclassStatesprovides domain-based access to entity states, e.g.app.states.light.get("light.my_light")Stateslistens 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 handlersMaybeStateNew,MaybeStateOld,MaybeEntityId, etc.- These will allow
NoneorMISSING_VALUEto 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_typetoHassetteConfigto control whether to raise an error if a dependency cannot be provided due to type mismatch- Default is
truein production mode,falsein dev mode - When
falsea warning will be logged but the handler will still be called with whatever value was returned
- Default is
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
DomainLiteralinhassette.models.states.base- Add tests to catch this in the future
Full Changelog: v0.16.0...v0.17.0
v0.16.0
[0.16.0] - 2025-11-16
Added
- Added
ANY_VALUEsentinel for clearer semantics in predicates - use this to indicate "any value is acceptable" - Dependency Injection for Event Handlers - Handlers can now use
Annotatedtype hints with dependency markers fromhassette.dependenciesto 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.dependenciesmodule documentation and updated examples for details
- Available dependencies include
Changed
- Breaking: - Event handlers can no longer receive positional only args or variadic positional args
NOT_PROVIDEDpredicate 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
[0.15.5] - 2025-11-14
Changed
- Update
HassetteConfigdefaults 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 = truein dev mode)
- Generally speaking, values are extended (e.g. timeouts) and more permissive (e.g.
- Moved
AppManifestandHassetteTomlConfigSettingsSourcetoclasses.py - Moved
LOG_LEVELStohassette.types.typesinstead ofconst.misc, as this is aLiteral, not a list of constants - Renamed
core_config.pytocore.py - Bumped version of
uvinmise.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_changeswas called, due to improper reloading of configuration- Now uses
HassetteConfig.reload()to reload config instead of re-initializing the class
- Now uses
Full Changelog: v0.15.4...v0.15.5
v0.15.4
[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
entitiesback to public API exports fromhassette
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.errorand short traceback instead oflogger.exception
Full Changelog: v0.15.3...v0.15.4