Use device class voltage in NUT integration (#48096)
This commit is contained in:
parent
66b537c0e3
commit
7858b59944
1 changed files with 26 additions and 10 deletions
|
@ -4,6 +4,7 @@ from homeassistant.components.sensor import (
|
||||||
DEVICE_CLASS_HUMIDITY,
|
DEVICE_CLASS_HUMIDITY,
|
||||||
DEVICE_CLASS_POWER,
|
DEVICE_CLASS_POWER,
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
DEVICE_CLASS_TEMPERATURE,
|
||||||
|
DEVICE_CLASS_VOLTAGE,
|
||||||
)
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ELECTRICAL_CURRENT_AMPERE,
|
ELECTRICAL_CURRENT_AMPERE,
|
||||||
|
@ -120,10 +121,15 @@ SENSOR_TYPES = {
|
||||||
None,
|
None,
|
||||||
],
|
],
|
||||||
"battery.charger.status": ["Charging Status", "", "mdi:information-outline", None],
|
"battery.charger.status": ["Charging Status", "", "mdi:information-outline", None],
|
||||||
"battery.voltage": ["Battery Voltage", VOLT, "mdi:flash", None],
|
"battery.voltage": ["Battery Voltage", VOLT, None, DEVICE_CLASS_VOLTAGE],
|
||||||
"battery.voltage.nominal": ["Nominal Battery Voltage", VOLT, "mdi:flash", None],
|
"battery.voltage.nominal": [
|
||||||
"battery.voltage.low": ["Low Battery Voltage", VOLT, "mdi:flash", None],
|
"Nominal Battery Voltage",
|
||||||
"battery.voltage.high": ["High Battery Voltage", VOLT, "mdi:flash", None],
|
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.capacity": ["Battery Capacity", "Ah", "mdi:flash", None],
|
||||||
"battery.current": [
|
"battery.current": [
|
||||||
"Battery Current",
|
"Battery Current",
|
||||||
|
@ -178,16 +184,21 @@ SENSOR_TYPES = {
|
||||||
"mdi:information-outline",
|
"mdi:information-outline",
|
||||||
None,
|
None,
|
||||||
],
|
],
|
||||||
"input.transfer.low": ["Low Voltage Transfer", VOLT, "mdi:flash", None],
|
"input.transfer.low": ["Low Voltage Transfer", VOLT, None, DEVICE_CLASS_VOLTAGE],
|
||||||
"input.transfer.high": ["High Voltage Transfer", VOLT, "mdi:flash", None],
|
"input.transfer.high": ["High Voltage Transfer", VOLT, None, DEVICE_CLASS_VOLTAGE],
|
||||||
"input.transfer.reason": [
|
"input.transfer.reason": [
|
||||||
"Voltage Transfer Reason",
|
"Voltage Transfer Reason",
|
||||||
"",
|
"",
|
||||||
"mdi:information-outline",
|
"mdi:information-outline",
|
||||||
None,
|
None,
|
||||||
],
|
],
|
||||||
"input.voltage": ["Input Voltage", VOLT, "mdi:flash", None],
|
"input.voltage": ["Input Voltage", VOLT, None, DEVICE_CLASS_VOLTAGE],
|
||||||
"input.voltage.nominal": ["Nominal Input Voltage", VOLT, "mdi:flash", None],
|
"input.voltage.nominal": [
|
||||||
|
"Nominal Input Voltage",
|
||||||
|
VOLT,
|
||||||
|
None,
|
||||||
|
DEVICE_CLASS_VOLTAGE,
|
||||||
|
],
|
||||||
"input.frequency": ["Input Line Frequency", FREQUENCY_HERTZ, "mdi:flash", None],
|
"input.frequency": ["Input Line Frequency", FREQUENCY_HERTZ, "mdi:flash", None],
|
||||||
"input.frequency.nominal": [
|
"input.frequency.nominal": [
|
||||||
"Nominal Input Line Frequency",
|
"Nominal Input Line Frequency",
|
||||||
|
@ -208,8 +219,13 @@ SENSOR_TYPES = {
|
||||||
"mdi:flash",
|
"mdi:flash",
|
||||||
None,
|
None,
|
||||||
],
|
],
|
||||||
"output.voltage": ["Output Voltage", VOLT, "mdi:flash", None],
|
"output.voltage": ["Output Voltage", VOLT, None, DEVICE_CLASS_VOLTAGE],
|
||||||
"output.voltage.nominal": ["Nominal Output Voltage", VOLT, "mdi:flash", None],
|
"output.voltage.nominal": [
|
||||||
|
"Nominal Output Voltage",
|
||||||
|
VOLT,
|
||||||
|
None,
|
||||||
|
DEVICE_CLASS_VOLTAGE,
|
||||||
|
],
|
||||||
"output.frequency": ["Output Frequency", FREQUENCY_HERTZ, "mdi:flash", None],
|
"output.frequency": ["Output Frequency", FREQUENCY_HERTZ, "mdi:flash", None],
|
||||||
"output.frequency.nominal": [
|
"output.frequency.nominal": [
|
||||||
"Nominal Output Frequency",
|
"Nominal Output Frequency",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue