Add entity categories to most NUT entities (#58798)

* Add entity cateogories to most NUT entites

* changes to categories
This commit is contained in:
Thanasis 2021-11-09 18:25:19 +01:00 committed by GitHub
parent 032786fcd8
commit 4b228e3add
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,8 +16,8 @@ from homeassistant.components.sensor import (
from homeassistant.const import (
ELECTRIC_CURRENT_AMPERE,
ELECTRIC_POTENTIAL_VOLT,
ENTITY_CATEGORY_CONFIG,
ENTITY_CATEGORY_DIAGNOSTIC,
ENTITY_CATEGORY_SYSTEM,
FREQUENCY_HERTZ,
PERCENTAGE,
POWER_VOLT_AMPERE,
@ -81,58 +81,62 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
name="Overload Setting",
native_unit_of_measurement=PERCENTAGE,
icon="mdi:gauge",
entity_category=ENTITY_CATEGORY_CONFIG,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.id": SensorEntityDescription(
key="ups.id",
name="System identifier",
icon="mdi:information-outline",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.delay.start": SensorEntityDescription(
key="ups.delay.start",
name="Load Restart Delay",
native_unit_of_measurement=TIME_SECONDS,
icon="mdi:timer-outline",
entity_category=ENTITY_CATEGORY_CONFIG,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.delay.reboot": SensorEntityDescription(
key="ups.delay.reboot",
name="UPS Reboot Delay",
native_unit_of_measurement=TIME_SECONDS,
icon="mdi:timer-outline",
entity_category=ENTITY_CATEGORY_CONFIG,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.delay.shutdown": SensorEntityDescription(
key="ups.delay.shutdown",
name="UPS Shutdown Delay",
native_unit_of_measurement=TIME_SECONDS,
icon="mdi:timer-outline",
entity_category=ENTITY_CATEGORY_CONFIG,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.timer.start": SensorEntityDescription(
key="ups.timer.start",
name="Load Start Timer",
native_unit_of_measurement=TIME_SECONDS,
icon="mdi:timer-outline",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.timer.reboot": SensorEntityDescription(
key="ups.timer.reboot",
name="Load Reboot Timer",
native_unit_of_measurement=TIME_SECONDS,
icon="mdi:timer-outline",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.timer.shutdown": SensorEntityDescription(
key="ups.timer.shutdown",
name="Load Shutdown Timer",
native_unit_of_measurement=TIME_SECONDS,
icon="mdi:timer-outline",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.test.interval": SensorEntityDescription(
key="ups.test.interval",
name="Self-Test Interval",
native_unit_of_measurement=TIME_SECONDS,
icon="mdi:timer-outline",
entity_category=ENTITY_CATEGORY_CONFIG,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.test.result": SensorEntityDescription(
key="ups.test.result",
@ -150,11 +154,13 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
key="ups.display.language",
name="Language",
icon="mdi:information-outline",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.contacts": SensorEntityDescription(
key="ups.contacts",
name="External Contacts",
icon="mdi:information-outline",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.efficiency": SensorEntityDescription(
key="ups.efficiency",
@ -162,6 +168,7 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
native_unit_of_measurement=PERCENTAGE,
icon="mdi:gauge",
state_class=STATE_CLASS_MEASUREMENT,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.power": SensorEntityDescription(
key="ups.power",
@ -169,12 +176,14 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
native_unit_of_measurement=POWER_VOLT_AMPERE,
icon="mdi:flash",
state_class=STATE_CLASS_MEASUREMENT,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.power.nominal": SensorEntityDescription(
key="ups.power.nominal",
name="Nominal Power",
native_unit_of_measurement=POWER_VOLT_AMPERE,
icon="mdi:flash",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.realpower": SensorEntityDescription(
key="ups.realpower",
@ -182,22 +191,26 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
native_unit_of_measurement=POWER_WATT,
device_class=DEVICE_CLASS_POWER,
state_class=STATE_CLASS_MEASUREMENT,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.realpower.nominal": SensorEntityDescription(
key="ups.realpower.nominal",
name="Nominal Real Power",
native_unit_of_measurement=POWER_WATT,
device_class=DEVICE_CLASS_POWER,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.beeper.status": SensorEntityDescription(
key="ups.beeper.status",
name="Beeper Status",
icon="mdi:information-outline",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.type": SensorEntityDescription(
key="ups.type",
name="UPS Type",
icon="mdi:information-outline",
entity_category=ENTITY_CATEGORY_SYSTEM,
),
"ups.watchdog.status": SensorEntityDescription(
key="ups.watchdog.status",
@ -209,21 +222,25 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
key="ups.start.auto",
name="Start on AC",
icon="mdi:information-outline",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.start.battery": SensorEntityDescription(
key="ups.start.battery",
name="Start on Battery",
icon="mdi:information-outline",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.start.reboot": SensorEntityDescription(
key="ups.start.reboot",
name="Reboot on Battery",
icon="mdi:information-outline",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ups.shutdown": SensorEntityDescription(
key="ups.shutdown",
name="Shutdown Ability",
icon="mdi:information-outline",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"battery.charge": SensorEntityDescription(
key="battery.charge",
@ -231,27 +248,27 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_BATTERY,
state_class=STATE_CLASS_MEASUREMENT,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"battery.charge.low": SensorEntityDescription(
key="battery.charge.low",
name="Low Battery Setpoint",
native_unit_of_measurement=PERCENTAGE,
icon="mdi:gauge",
entity_category=ENTITY_CATEGORY_CONFIG,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"battery.charge.restart": SensorEntityDescription(
key="battery.charge.restart",
name="Minimum Battery to Start",
native_unit_of_measurement=PERCENTAGE,
icon="mdi:gauge",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"battery.charge.warning": SensorEntityDescription(
key="battery.charge.warning",
name="Warning Battery Setpoint",
native_unit_of_measurement=PERCENTAGE,
icon="mdi:gauge",
entity_category=ENTITY_CATEGORY_CONFIG,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"battery.charger.status": SensorEntityDescription(
key="battery.charger.status",
@ -264,30 +281,35 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
device_class=DEVICE_CLASS_VOLTAGE,
state_class=STATE_CLASS_MEASUREMENT,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"battery.voltage.nominal": SensorEntityDescription(
key="battery.voltage.nominal",
name="Nominal Battery Voltage",
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
device_class=DEVICE_CLASS_VOLTAGE,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"battery.voltage.low": SensorEntityDescription(
key="battery.voltage.low",
name="Low Battery Voltage",
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
device_class=DEVICE_CLASS_VOLTAGE,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"battery.voltage.high": SensorEntityDescription(
key="battery.voltage.high",
name="High Battery Voltage",
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
device_class=DEVICE_CLASS_VOLTAGE,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"battery.capacity": SensorEntityDescription(
key="battery.capacity",
name="Battery Capacity",
native_unit_of_measurement="Ah",
icon="mdi:flash",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"battery.current": SensorEntityDescription(
key="battery.current",
@ -295,12 +317,14 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
icon="mdi:flash",
state_class=STATE_CLASS_MEASUREMENT,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"battery.current.total": SensorEntityDescription(
key="battery.current.total",
name="Total Battery Current",
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
icon="mdi:flash",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"battery.temperature": SensorEntityDescription(
key="battery.temperature",
@ -322,65 +346,76 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
name="Low Battery Runtime",
native_unit_of_measurement=TIME_SECONDS,
icon="mdi:timer-outline",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"battery.runtime.restart": SensorEntityDescription(
key="battery.runtime.restart",
name="Minimum Battery Runtime to Start",
native_unit_of_measurement=TIME_SECONDS,
icon="mdi:timer-outline",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"battery.alarm.threshold": SensorEntityDescription(
key="battery.alarm.threshold",
name="Battery Alarm Threshold",
icon="mdi:information-outline",
entity_category=ENTITY_CATEGORY_CONFIG,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"battery.date": SensorEntityDescription(
key="battery.date",
name="Battery Date",
icon="mdi:calendar",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"battery.mfr.date": SensorEntityDescription(
key="battery.mfr.date",
name="Battery Manuf. Date",
icon="mdi:calendar",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"battery.packs": SensorEntityDescription(
key="battery.packs",
name="Number of Batteries",
icon="mdi:information-outline",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"battery.packs.bad": SensorEntityDescription(
key="battery.packs.bad",
name="Number of Bad Batteries",
icon="mdi:information-outline",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"battery.type": SensorEntityDescription(
key="battery.type",
name="Battery Chemistry",
icon="mdi:information-outline",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"input.sensitivity": SensorEntityDescription(
key="input.sensitivity",
name="Input Power Sensitivity",
icon="mdi:information-outline",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"input.transfer.low": SensorEntityDescription(
key="input.transfer.low",
name="Low Voltage Transfer",
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
device_class=DEVICE_CLASS_VOLTAGE,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"input.transfer.high": SensorEntityDescription(
key="input.transfer.high",
name="High Voltage Transfer",
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
device_class=DEVICE_CLASS_VOLTAGE,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"input.transfer.reason": SensorEntityDescription(
key="input.transfer.reason",
name="Voltage Transfer Reason",
icon="mdi:information-outline",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"input.voltage": SensorEntityDescription(
key="input.voltage",
@ -394,6 +429,7 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
name="Nominal Input Voltage",
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
device_class=DEVICE_CLASS_VOLTAGE,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"input.frequency": SensorEntityDescription(
key="input.frequency",
@ -401,17 +437,20 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
native_unit_of_measurement=FREQUENCY_HERTZ,
icon="mdi:flash",
state_class=STATE_CLASS_MEASUREMENT,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"input.frequency.nominal": SensorEntityDescription(
key="input.frequency.nominal",
name="Nominal Input Line Frequency",
native_unit_of_measurement=FREQUENCY_HERTZ,
icon="mdi:flash",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"input.frequency.status": SensorEntityDescription(
key="input.frequency.status",
name="Input Frequency Status",
icon="mdi:information-outline",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"output.current": SensorEntityDescription(
key="output.current",
@ -419,12 +458,14 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
icon="mdi:flash",
state_class=STATE_CLASS_MEASUREMENT,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"output.current.nominal": SensorEntityDescription(
key="output.current.nominal",
name="Nominal Output Current",
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
icon="mdi:flash",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"output.voltage": SensorEntityDescription(
key="output.voltage",
@ -438,6 +479,7 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
name="Nominal Output Voltage",
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
device_class=DEVICE_CLASS_VOLTAGE,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"output.frequency": SensorEntityDescription(
key="output.frequency",
@ -445,12 +487,14 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
native_unit_of_measurement=FREQUENCY_HERTZ,
icon="mdi:flash",
state_class=STATE_CLASS_MEASUREMENT,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"output.frequency.nominal": SensorEntityDescription(
key="output.frequency.nominal",
name="Nominal Output Frequency",
native_unit_of_measurement=FREQUENCY_HERTZ,
icon="mdi:flash",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ambient.humidity": SensorEntityDescription(
key="ambient.humidity",
@ -458,6 +502,7 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY,
state_class=STATE_CLASS_MEASUREMENT,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"ambient.temperature": SensorEntityDescription(
key="ambient.temperature",
@ -465,6 +510,7 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
native_unit_of_measurement=TEMP_CELSIUS,
device_class=DEVICE_CLASS_TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
"watts": SensorEntityDescription(
key="watts",