Add ambient sensors to nut integration (#47411)

This commit is contained in:
Michael 2021-03-12 18:19:55 +01:00 committed by GitHub
parent 04b335afe9
commit 72cb1f5480
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
"""The nut component."""
from homeassistant.components.sensor import (
DEVICE_CLASS_BATTERY,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_POWER,
DEVICE_CLASS_TEMPERATURE,
)
@ -45,7 +46,7 @@ SENSOR_TYPES = {
"ups.temperature": [
"UPS Temperature",
TEMP_CELSIUS,
"mdi:thermometer",
None,
DEVICE_CLASS_TEMPERATURE,
],
"ups.load": ["Load", PERCENTAGE, "mdi:gauge", None],
@ -83,13 +84,13 @@ SENSOR_TYPES = {
"ups.realpower": [
"Current Real Power",
POWER_WATT,
"mdi:flash",
None,
DEVICE_CLASS_POWER,
],
"ups.realpower.nominal": [
"Nominal Real Power",
POWER_WATT,
"mdi:flash",
None,
DEVICE_CLASS_POWER,
],
"ups.beeper.status": ["Beeper Status", "", "mdi:information-outline", None],
@ -102,7 +103,7 @@ SENSOR_TYPES = {
"battery.charge": [
"Battery Charge",
PERCENTAGE,
"mdi:gauge",
None,
DEVICE_CLASS_BATTERY,
],
"battery.charge.low": ["Low Battery Setpoint", PERCENTAGE, "mdi:gauge", None],
@ -139,7 +140,7 @@ SENSOR_TYPES = {
"battery.temperature": [
"Battery Temperature",
TEMP_CELSIUS,
"mdi:thermometer",
None,
DEVICE_CLASS_TEMPERATURE,
],
"battery.runtime": ["Battery Runtime", TIME_SECONDS, "mdi:timer-outline", None],
@ -216,6 +217,18 @@ SENSOR_TYPES = {
"mdi:flash",
None,
],
"ambient.humidity": [
"Ambient Humidity",
PERCENTAGE,
None,
DEVICE_CLASS_HUMIDITY,
],
"ambient.temperature": [
"Ambient Temperature",
TEMP_CELSIUS,
None,
DEVICE_CLASS_TEMPERATURE,
],
}
STATE_TYPES = {