diff --git a/custom_components/hilo/__init__.py b/custom_components/hilo/__init__.py index cade7af0..7b632853 100644 --- a/custom_components/hilo/__init__.py +++ b/custom_components/hilo/__init__.py @@ -215,6 +215,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: hass, entry, implementation ), log_traces=current_options.get(CONF_LOG_TRACES, DEFAULT_LOG_TRACES), + state_yaml=hass.config.path("hilo_state.yaml"), ) except (TimeoutError, client_exceptions.ClientConnectorError): diff --git a/custom_components/hilo/sensor.py b/custom_components/hilo/sensor.py index 6daf2e25..aaf1fcf1 100755 --- a/custom_components/hilo/sensor.py +++ b/custom_components/hilo/sensor.py @@ -739,7 +739,9 @@ def __init__(self, hilo, device, scan_interval): Platform.SENSOR, ) LOG.debug("Setting up RewardSensor entity: %s", self._attr_name) - self._history_state_yaml: str = "hilo_eventhistory_state.yaml" + self._history_state_yaml: str = hilo._hass.config.path( + "hilo_eventhistory_state.yaml" + ) self.scan_interval = timedelta(seconds=REWARD_SCAN_INTERVAL) self._state = 0 self._history = []