Skip to content
Snippets Groups Projects
Commit 18721fbd authored by jkerdreu's avatar jkerdreu
Browse files

- Added GW

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@3004 b32b6428-25c9-4566-ad07-03861ab6144f
parent 05d0c5a3
No related branches found
No related tags found
No related merge requests found
...@@ -44,6 +44,9 @@ class Factory(EntityFactory): ...@@ -44,6 +44,9 @@ class Factory(EntityFactory):
if device.dev_type.startswith('co2meter.'): if device.dev_type.startswith('co2meter.'):
entity = CO2Meter(device, self._bridge) entity = CO2Meter(device, self._bridge)
if device.dev_type.startswith('gateway.'):
entity = Gateway(device, self._bridge)
if entity: if entity:
self.add_entity(entity, device.address) self.add_entity(entity, device.address)
return True return True
...@@ -99,4 +102,13 @@ class CO2Meter(XAALSensorEntity): ...@@ -99,4 +102,13 @@ class CO2Meter(XAALSensorEntity):
_attr_native_unit_of_measurement = const.CONCENTRATION_PARTS_PER_MILLION _attr_native_unit_of_measurement = const.CONCENTRATION_PARTS_PER_MILLION
_xaal_attribute = 'co2' _xaal_attribute = 'co2'
\ No newline at end of file class Gateway(XAALEntity, SensorEntity):
_attr_native_unit_of_measurement = "embedded"
_attr_icon: str | None = "mdi:swap-horizontal"
@property
def native_value(self) -> Any:
embs = self.get_attribute("embedded")
return len(embs) if embs else 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment