Skip to content

Commit

Permalink
Update for HA impending import relocation
Browse files Browse the repository at this point in the history
  • Loading branch information
rgc99 committed Aug 3, 2024
1 parent 3238974 commit 7778a80
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions custom_components/irrigation_unlimited/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
from typing import Callable, OrderedDict, Any
from homeassistant.core import HomeAssistant, State, CALLBACK_TYPE
from homeassistant.util import dt
from homeassistant.components.recorder.const import DATA_INSTANCE as RECORDER_INSTANCE

try:
from homeassistant.helpers.recorder import DATA_INSTANCE
except ImportError:
from homeassistant.components.recorder.const import DATA_INSTANCE
from homeassistant.components.recorder import get_instance
from homeassistant.helpers.event import (
async_track_point_in_utc_time,
Expand Down Expand Up @@ -201,7 +205,7 @@ async def _async_update_history(self, stime: datetime) -> None:
return

start = self._stime - self._history_span
if RECORDER_INSTANCE in self._hass.data:
if DATA_INSTANCE in self._hass.data:
data = await get_instance(self._hass).async_add_executor_job(
history.get_significant_states,
self._hass,
Expand Down

0 comments on commit 7778a80

Please sign in to comment.