Releases: pnbruckner/ha-entity-tz
Fix install issue w/ HA 2024.10.0b0
What's Changed
- Fix install issue w/ HA 2024.10.0b0 by bumping timezonefinder package to 6.5.3.
Full Changelog: 1.2.1...1.2.2
Call dt_util.get_time_zone in an executor
What's Changed
- Call dt_util.get_time_zone in an executor.
- Use dt_util.get_default_time_zone which is new in HA 2024.6.
Full Changelog: 1.2.0...1.2.1
Add detail attributes to address sensor
Nominatim provides address details in addition to the "combined address" string currently used for the address sensor's state. Add an attribute to the address sensor for each of the details provided.
Catch exceptions raised by TimezoneFinder.timezone_at
The timezone_at method will sometimes raise a struct.error exception. This release catches those and any other exceptions that method might raise and writes a debug message to the log.
Miscellaneous bug fixes & prep for upcoming HA release
Some code that should not have been running in the event loop has been moved to run in an executor. Also, prepare for changes in an upcoming HA release.
Cache time zone from lat/lon results
Determining time zone from lat & lon can take a significant amount of time. Since time zone will not change for same lat/lon values, add a cache of calculated values. To maximize cache hits, round lat & lon to 4 digits each (which is equivalent to about 11 meters, similar to what is done for Nominatim location caching.)
Also, in update_zones, ignore events without data. For some reason, at startup, there are two core_config_updated events fired (with no data), even though the core config has not actually changed. Ignoring these eliminates unnecessary time zone lookups for HA zones.
Move lengthy process from callback to coroutine
At startup, and after any HA zone or HA's core config is changed, a list of zones is created to be used in the config flow. Each zone's time zone needs to be determined, and this process can take a significant amount of time. This was being done in an event loop callback, which can have a negative effect on overall system performance and responsiveness. This change moves that code into a coroutine which yields to other tasks after each zone's time zone is determined.
Initial release of Entity Time Zone Sensor
This replaces 1.0.0 release which had a bad version string in manifest.json.