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

- Added CO2 Meter

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@2996 b32b6428-25c9-4566-ad07-03861ab6144f
parent 1d36d6d4
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@ _LOGGER = logging.getLogger(__name__)
#DB_SERVER = tools.get_uuid('d28fbc27-190f-4ee5-815a-fe05233400a2')
DB_SERVER = tools.get_uuid('9064ccbc-84ea-11e8-80cc-82ed25e6aaaa')
UNSUPPORTED_TYPES = ['cli','hmi','gateway','windgauge','barometer','co2meter','soundmeter']
UNSUPPORTED_TYPES = ['cli','hmi','gateway','windgauge','barometer','soundmeter']
def filter_msg(msg):
......
......@@ -36,6 +36,9 @@ class Factory(EntityFactory):
if device.dev_type.startswith('luxmeter.'):
entity = LuxMeter(device, self._bridge)
if device.dev_type.startswith('co2meter.'):
entity = CO2Meter(device, self._bridge)
if entity:
self.add_entity(entity, device.address)
return True
......@@ -83,4 +86,12 @@ class WifiMeter(XAALSensorEntity):
class LuxMeter(XAALSensorEntity):
_attr_device_class = SensorDeviceClass.ILLUMINANCE
_attr_native_unit_of_measurement = const.LIGHT_LUX
_xaal_attribute = 'illuminance'
\ No newline at end of file
_xaal_attribute = 'illuminance'
class CO2Meter(XAALSensorEntity):
_attr_device_class = SensorDeviceClass.CO2
_attr_native_unit_of_measurement = const.CONCENTRATION_PARTS_PER_MILLION
_xaal_attribute = 'co2'
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment