Skip to content

Commit

Permalink
Adds battery and voltage sensors
Browse files Browse the repository at this point in the history
  • Loading branch information
sverrham committed Jan 30, 2022
1 parent eeec873 commit c72440a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions custom_components/airthings_wave/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
DEVICE_CLASS_TEMPERATURE,
DEVICE_CLASS_PRESSURE,
DEVICE_CLASS_TIMESTAMP,
DEVICE_CLASS_BATTERY,
DEVICE_CLASS_VOLTAGE,
EVENT_HOMEASSISTANT_STOP, ILLUMINANCE,
STATE_UNKNOWN)

Expand Down Expand Up @@ -149,6 +151,8 @@ def get_extra_attributes(self, data):


DEVICE_SENSOR_SPECIFICS = { "date_time":Sensor('time', None, None, None),
"battery":Sensor(PERCENT, None, DEVICE_CLASS_BATTERY, 'mdi:battery'),
"voltage":Sensor('V', None, DEVICE_CLASS_VOLTAGE, None),
"temperature":Sensor(TEMP_CELSIUS, None, DEVICE_CLASS_TEMPERATURE, None),
"humidity": Sensor(PERCENT, None, DEVICE_CLASS_HUMIDITY, None),
"rel_atm_pressure": PressureSensor(ATM_METRIC_UNITS, None, DEVICE_CLASS_PRESSURE, None),
Expand Down

0 comments on commit c72440a

Please sign in to comment.