Use device class voltage in NUT integration (#48096)

pull/48106/head
Maciej Bieniek 2021-03-19 10:25:17 +01:00 committed by GitHub
parent 66b537c0e3
commit 7858b59944
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 10 deletions

View File

@ -4,6 +4,7 @@ from homeassistant.components.sensor import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_POWER,
DEVICE_CLASS_TEMPERATURE,
DEVICE_CLASS_VOLTAGE,
)
from homeassistant.const import (
ELECTRICAL_CURRENT_AMPERE,
@ -120,10 +121,15 @@ SENSOR_TYPES = {
None,
],
"battery.charger.status": ["Charging Status", "", "mdi:information-outline", None],
"battery.voltage": ["Battery Voltage", VOLT, "mdi:flash", None],
"battery.voltage.nominal": ["Nominal Battery Voltage", VOLT, "mdi:flash", None],
"battery.voltage.low": ["Low Battery Voltage", VOLT, "mdi:flash", None],
"battery.voltage.high": ["High Battery Voltage", VOLT, "mdi:flash", None],
"battery.voltage": ["Battery Voltage", VOLT, None, DEVICE_CLASS_VOLTAGE],
"battery.voltage.nominal": [
"Nominal Battery Voltage",
VOLT,
None,
DEVICE_CLASS_VOLTAGE,
],
"battery.voltage.low": ["Low Battery Voltage", VOLT, None, DEVICE_CLASS_VOLTAGE],
"battery.voltage.high": ["High Battery Voltage", VOLT, None, DEVICE_CLASS_VOLTAGE],
"battery.capacity": ["Battery Capacity", "Ah", "mdi:flash", None],
"battery.current": [
"Battery Current",
@ -178,16 +184,21 @@ SENSOR_TYPES = {
"mdi:information-outline",
None,
],
"input.transfer.low": ["Low Voltage Transfer", VOLT, "mdi:flash", None],
"input.transfer.high": ["High Voltage Transfer", VOLT, "mdi:flash", None],
"input.transfer.low": ["Low Voltage Transfer", VOLT, None, DEVICE_CLASS_VOLTAGE],
"input.transfer.high": ["High Voltage Transfer", VOLT, None, DEVICE_CLASS_VOLTAGE],
"input.transfer.reason": [
"Voltage Transfer Reason",
"",
"mdi:information-outline",
None,
],
"input.voltage": ["Input Voltage", VOLT, "mdi:flash", None],
"input.voltage.nominal": ["Nominal Input Voltage", VOLT, "mdi:flash", None],
"input.voltage": ["Input Voltage", VOLT, None, DEVICE_CLASS_VOLTAGE],
"input.voltage.nominal": [
"Nominal Input Voltage",
VOLT,
None,
DEVICE_CLASS_VOLTAGE,
],
"input.frequency": ["Input Line Frequency", FREQUENCY_HERTZ, "mdi:flash", None],
"input.frequency.nominal": [
"Nominal Input Line Frequency",
@ -208,8 +219,13 @@ SENSOR_TYPES = {
"mdi:flash",
None,
],
"output.voltage": ["Output Voltage", VOLT, "mdi:flash", None],
"output.voltage.nominal": ["Nominal Output Voltage", VOLT, "mdi:flash", None],
"output.voltage": ["Output Voltage", VOLT, None, DEVICE_CLASS_VOLTAGE],
"output.voltage.nominal": [
"Nominal Output Voltage",
VOLT,
None,
DEVICE_CLASS_VOLTAGE,
],
"output.frequency": ["Output Frequency", FREQUENCY_HERTZ, "mdi:flash", None],
"output.frequency.nominal": [
"Nominal Output Frequency",