Replace is_metric with is METRIC_SYSTEM (#80262)

This commit is contained in:
epenet 2022-10-14 12:22:11 +02:00 committed by GitHub
parent faeb663dfe
commit 1445e08090
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 47 additions and 23 deletions

View file

@ -35,6 +35,7 @@ from homeassistant.const import (
from homeassistant.core import HomeAssistant
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util.unit_system import METRIC_SYSTEM
from .. import mysensors
from .const import MYSENSORS_DISCOVERY, DiscoveryInfo
@ -242,7 +243,7 @@ class MySensorsSensor(mysensors.device.MySensorsEntity, SensorEntity):
return custom_unit
if set_req(self.value_type) == set_req.V_TEMP:
if self.hass.config.units.is_metric:
if self.hass.config.units is METRIC_SYSTEM:
return TEMP_CELSIUS
return TEMP_FAHRENHEIT