Skip to content
Snippets Groups Projects
Commit 1b1e761f authored by jkerdreu's avatar jkerdreu
Browse files

- Switch to new units

- Fix the space issue on ha_name

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@3054 b32b6428-25c9-4566-ad07-03861ab6144f
parent 6cc6bcb4
No related branches found
No related tags found
No related merge requests found
......@@ -111,7 +111,7 @@ class XAALEntity(Entity):
db_name = self._dev.db.get('ha_name')
dev_name = self._dev.db.get('ha_dev_name')
if dev_name and db_name:
db_name = db_name.removeprefix(dev_name)
db_name = db_name.removeprefix(f"{dev_name} ")
force_name = getattr(self, '_force_name', None)
name = db_name or force_name or self.device_class or self.short_type()
......
......@@ -58,7 +58,7 @@ class Hygrometer(XAALSensorEntity):
class Barometer(XAALSensorEntity):
_attr_device_class = SensorDeviceClass.PRESSURE
_attr_native_unit_of_measurement = const.PRESSURE_HPA
_attr_native_unit_of_measurement = const.UnitOfPressure.HPA
_xaal_attribute = 'pressure'
......@@ -71,7 +71,7 @@ class Battery(XAALSensorEntity):
class PowerMeter(XAALSensorEntity):
_attr_device_class = SensorDeviceClass.POWER
_attr_native_unit_of_measurement = const.POWER_WATT
_attr_native_unit_of_measurement = const.UnitOfPower.WATT
_xaal_attribute = 'power'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment