|
13 | 13 | https://home-assistant.io/components/sensor.airthings_wave/ |
14 | 14 | """ |
15 | 15 | import logging |
16 | | -import threading |
17 | 16 | from datetime import timedelta |
18 | 17 |
|
19 | 18 | from .airthings import AirthingsWaveDetect |
|
33 | 32 | EVENT_HOMEASSISTANT_STOP, ILLUMINANCE, |
34 | 33 | STATE_UNKNOWN) |
35 | 34 | from homeassistant.helpers.entity import Entity |
36 | | -VERSION = '0.5.0' |
37 | | - |
38 | | -REQUIREMENTS = ['pygatt[GATTTOOL]==4.0.3'] |
39 | 35 |
|
40 | 36 | _LOGGER = logging.getLogger(__name__) |
41 | | -DEFAULT_NAME = 'Airthings Wave' |
42 | | -CONNECT_LOCK = threading.Lock() |
43 | 37 | CONNECT_TIMEOUT = 30 |
44 | 38 | SCAN_INTERVAL = timedelta(seconds=300) |
45 | 39 |
|
@@ -118,14 +112,14 @@ def get_extra_attributes(self, data): |
118 | 112 | return {ATTR_RADON_LEVEL: radon_level} |
119 | 113 |
|
120 | 114 |
|
121 | | -DEVICE_SENSOR_SPECIFICS = {"date_time":Sensor('time', None, None, None), |
122 | | - "temperature":Sensor(TEMP_CELSIUS, None, DEVICE_CLASS_TEMPERATURE, None), |
123 | | - "humidity": Sensor(PERCENT, None, DEVICE_CLASS_HUMIDITY, None), |
124 | | - "rel_atm_pressure": Sensor(ATM_METRIC_UNITS, None, DEVICE_CLASS_PRESSURE, None), |
125 | | - "co2": Sensor(CO2_METRIC_UNITS, None, DEVICE_CLASS_CO2, 'mdi:periodic-table-co2'), |
126 | | - "voc": Sensor(VOC_METRIC_UNITS, None, DEVICE_CLASS_VOC, 'mdi:cloud'), |
127 | | - "illuminance": Sensor(ILLUMINANCE_LUX, None, DEVICE_CLASS_ILLUMINANCE, None), |
128 | | - "accelerometer": Sensor(SPEED_METRIC_UNITS, None, DEVICE_CLASS_ACCELEROMETER, 'mdi:vibrate'), |
| 115 | +DEVICE_SENSOR_SPECIFICS = { "date_time":Sensor('time', None, None, None), |
| 116 | + "temperature":Sensor(TEMP_CELSIUS, None, DEVICE_CLASS_TEMPERATURE, None), |
| 117 | + "humidity": Sensor(PERCENT, None, DEVICE_CLASS_HUMIDITY, None), |
| 118 | + "rel_atm_pressure": Sensor(ATM_METRIC_UNITS, None, DEVICE_CLASS_PRESSURE, None), |
| 119 | + "co2": Sensor(CO2_METRIC_UNITS, None, DEVICE_CLASS_CO2, 'mdi:periodic-table-co2'), |
| 120 | + "voc": Sensor(VOC_METRIC_UNITS, None, DEVICE_CLASS_VOC, 'mdi:cloud'), |
| 121 | + "illuminance": Sensor(ILLUMINANCE_LUX, None, DEVICE_CLASS_ILLUMINANCE, None), |
| 122 | + "accelerometer": Sensor(SPEED_METRIC_UNITS, None, DEVICE_CLASS_ACCELEROMETER, 'mdi:vibrate'), |
129 | 123 | "radon_1day_avg": RadonSensor(VOLUME_BECQUEREL, None, DEVICE_CLASS_RADON, 'mdi:radioactive'), |
130 | 124 | "radon_longterm_avg": RadonSensor(VOLUME_BECQUEREL, None, DEVICE_CLASS_RADON, 'mdi:radioactive') |
131 | 125 | } |
|
0 commit comments