Skip to content

Commit

Permalink
Add sensor HTU21D (#9)
Browse files Browse the repository at this point in the history
* Add temperature and humidity of HTU21D sensor
* Add HTU21D to list of sensors (Update docs)
  • Loading branch information
lichtteil authored Apr 21, 2020
1 parent 9e0c1c4 commit 7a9ca09
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ At the moment following sensor data can be read:
- BME280_temperature
- BME280_humidity
- BME280_pressure
- HTU21D_temperature
- HTU21D_humidity
Sensor type `signal` gives the wifi signal strength of the sensor device.

Expand Down
6 changes: 5 additions & 1 deletion custom_components/local_luftdaten/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
SENSOR_PM1 = 'SDS_P1'
SENSOR_PM2 = 'SDS_P2'
SENSOR_WIFI_SIGNAL = 'signal'
SENSOR_HTU21D_TEMPERATURE = 'HTU21D_temperature'
SENSOR_HTU21D_HUMIDITY = 'HTU21D_humidity'

SENSOR_TYPES = {
SENSOR_TEMPERATURE: ['Temperature', TEMP_CELSIUS],
Expand All @@ -46,7 +48,9 @@
SENSOR_BME280_PRESSURE: ['Pressure', 'mb'],
SENSOR_PM1: ['PM10', VOLUME_MICROGRAMS_PER_CUBIC_METER],
SENSOR_PM2: ['PM2.5', VOLUME_MICROGRAMS_PER_CUBIC_METER],
SENSOR_WIFI_SIGNAL: ['Wifi signal', 'dBm']
SENSOR_WIFI_SIGNAL: ['Wifi signal', 'dBm'],
SENSOR_HTU21D_TEMPERATURE: ['Temperature', TEMP_CELSIUS],
SENSOR_HTU21D_HUMIDITY: ['Humidity', '%']
}

DEFAULT_NAME = 'Luftdaten Sensor'
Expand Down

0 comments on commit 7a9ca09

Please sign in to comment.