Skip to content

Commit

Permalink
Fix deprecation warnings #65
Browse files Browse the repository at this point in the history
  • Loading branch information
Limych committed May 28, 2021
1 parent 670d750 commit 3530930
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion custom_components/average/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import homeassistant.util.dt as dt_util
import voluptuous as vol
from _sha1 import sha1
from homeassistant.components import history
from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN
from homeassistant.components.group import expand_entity_ids
from homeassistant.components.water_heater import DOMAIN as WATER_HEATER_DOMAIN
Expand Down Expand Up @@ -59,8 +58,12 @@
)

try:
# HA version >=2021.6
from homeassistant.components.recorder import history
from homeassistant.components.recorder.models import LazyState
except ImportError:
# HA version <=2021.5
from homeassistant.components import history
from homeassistant.components.history import LazyState


Expand Down

0 comments on commit 3530930

Please sign in to comment.