Fix Jewish Calendar unique id migration (#119683)

* Implement correct passing fix

* Keep the test as is, as it simulates the current behavior

* Last minor change
pull/115891/head
Tsvi Mostovicz 2024-06-17 13:37:30 +03:00 committed by GitHub
parent e0378f79a4
commit 369f9772f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -72,11 +72,14 @@ def get_unique_prefix(
havdalah_offset: int | None, havdalah_offset: int | None,
) -> str: ) -> str:
"""Create a prefix for unique ids.""" """Create a prefix for unique ids."""
# location.altitude was unset before 2024.6 when this method
# was used to create the unique id. As such it would always
# use the default altitude of 754.
config_properties = [ config_properties = [
location.latitude, location.latitude,
location.longitude, location.longitude,
location.timezone, location.timezone,
location.altitude, 754,
location.diaspora, location.diaspora,
language, language,
candle_lighting_offset, candle_lighting_offset,

View File

@ -38,7 +38,6 @@ async def test_import_unique_id_migration(hass: HomeAssistant) -> None:
latitude=yaml_conf[DOMAIN][CONF_LATITUDE], latitude=yaml_conf[DOMAIN][CONF_LATITUDE],
longitude=yaml_conf[DOMAIN][CONF_LONGITUDE], longitude=yaml_conf[DOMAIN][CONF_LONGITUDE],
timezone=hass.config.time_zone, timezone=hass.config.time_zone,
altitude=hass.config.elevation,
diaspora=DEFAULT_DIASPORA, diaspora=DEFAULT_DIASPORA,
) )
old_prefix = get_unique_prefix(location, DEFAULT_LANGUAGE, 20, 50) old_prefix = get_unique_prefix(location, DEFAULT_LANGUAGE, 20, 50)