diff --git a/homeassistant/components/mysensors/sensor.py b/homeassistant/components/mysensors/sensor.py index a62318aea53..1a5f7330ddf 100644 --- a/homeassistant/components/mysensors/sensor.py +++ b/homeassistant/components/mysensors/sensor.py @@ -1,6 +1,8 @@ """Support for MySensors sensors.""" from typing import Callable +from awesomeversion import AwesomeVersion + from homeassistant.components import mysensors from homeassistant.components.mysensors import on_unload from homeassistant.components.mysensors.const import MYSENSORS_DISCOVERY @@ -115,7 +117,7 @@ class MySensorsSensor(mysensors.device.MySensorsEntity, SensorEntity): """Return the unit of measurement of this entity.""" set_req = self.gateway.const.SetReq if ( - float(self.gateway.protocol_version) >= 1.5 + AwesomeVersion(self.gateway.protocol_version) >= AwesomeVersion("1.5") and set_req.V_UNIT_PREFIX in self._values ): return self._values[set_req.V_UNIT_PREFIX]