Skip to content

Commit

Permalink
Change from deprecated is_metric to METRIC_SYSTEM
Browse files Browse the repository at this point in the history
  • Loading branch information
allistermaguire committed Nov 8, 2022
1 parent 061175a commit c90842d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/wundergroundpws/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.util import Throttle
import homeassistant.helpers.config_validation as cv
from homeassistant.util.unit_system import METRIC_SYSTEM

# import homeassistant.config as config

Expand Down Expand Up @@ -363,7 +364,7 @@ async def async_setup_platform(hass: HomeAssistantType, config: ConfigType,
name_prefix = config.get(CONF_NAME)
numeric_precision = config.get(CONF_NUMERIC_PRECISION)

if hass.config.units.is_metric:
if hass.config.units is METRIC_SYSTEM:
unit_system_api = 'm'
unit_system = 'metric'
else:
Expand Down

0 comments on commit c90842d

Please sign in to comment.