mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 08:07:45 +00:00
Address late review of nut integration (#54606)
* remove defaults from SensorEntityDescription * use _attr_unique_id instead of unique_id() * check if unique_id is not None
This commit is contained in:
parent
d01addbd24
commit
9e2945680e
@ -51,32 +51,22 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
|
||||
"ups.status.display": SensorEntityDescription(
|
||||
key="ups.status.display",
|
||||
name="Status",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.status": SensorEntityDescription(
|
||||
key="ups.status",
|
||||
name="Status Data",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.alarm": SensorEntityDescription(
|
||||
key="ups.alarm",
|
||||
name="Alarms",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:alarm",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.temperature": SensorEntityDescription(
|
||||
key="ups.temperature",
|
||||
name="UPS Temperature",
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
@ -85,7 +75,6 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
|
||||
name="Load",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:gauge",
|
||||
device_class=None,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
"ups.load.high": SensorEntityDescription(
|
||||
@ -93,111 +82,79 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
|
||||
name="Overload Setting",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:gauge",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.id": SensorEntityDescription(
|
||||
key="ups.id",
|
||||
name="System identifier",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.delay.start": SensorEntityDescription(
|
||||
key="ups.delay.start",
|
||||
name="Load Restart Delay",
|
||||
native_unit_of_measurement=TIME_SECONDS,
|
||||
icon="mdi:timer-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.delay.reboot": SensorEntityDescription(
|
||||
key="ups.delay.reboot",
|
||||
name="UPS Reboot Delay",
|
||||
native_unit_of_measurement=TIME_SECONDS,
|
||||
icon="mdi:timer-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.delay.shutdown": SensorEntityDescription(
|
||||
key="ups.delay.shutdown",
|
||||
name="UPS Shutdown Delay",
|
||||
native_unit_of_measurement=TIME_SECONDS,
|
||||
icon="mdi:timer-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.timer.start": SensorEntityDescription(
|
||||
key="ups.timer.start",
|
||||
name="Load Start Timer",
|
||||
native_unit_of_measurement=TIME_SECONDS,
|
||||
icon="mdi:timer-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.timer.reboot": SensorEntityDescription(
|
||||
key="ups.timer.reboot",
|
||||
name="Load Reboot Timer",
|
||||
native_unit_of_measurement=TIME_SECONDS,
|
||||
icon="mdi:timer-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.timer.shutdown": SensorEntityDescription(
|
||||
key="ups.timer.shutdown",
|
||||
name="Load Shutdown Timer",
|
||||
native_unit_of_measurement=TIME_SECONDS,
|
||||
icon="mdi:timer-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.test.interval": SensorEntityDescription(
|
||||
key="ups.test.interval",
|
||||
name="Self-Test Interval",
|
||||
native_unit_of_measurement=TIME_SECONDS,
|
||||
icon="mdi:timer-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.test.result": SensorEntityDescription(
|
||||
key="ups.test.result",
|
||||
name="Self-Test Result",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.test.date": SensorEntityDescription(
|
||||
key="ups.test.date",
|
||||
name="Self-Test Date",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:calendar",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.display.language": SensorEntityDescription(
|
||||
key="ups.display.language",
|
||||
name="Language",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.contacts": SensorEntityDescription(
|
||||
key="ups.contacts",
|
||||
name="External Contacts",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.efficiency": SensorEntityDescription(
|
||||
key="ups.efficiency",
|
||||
name="Efficiency",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:gauge",
|
||||
device_class=None,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
"ups.power": SensorEntityDescription(
|
||||
@ -205,7 +162,6 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
|
||||
name="Current Apparent Power",
|
||||
native_unit_of_measurement=POWER_VOLT_AMPERE,
|
||||
icon="mdi:flash",
|
||||
device_class=None,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
"ups.power.nominal": SensorEntityDescription(
|
||||
@ -213,14 +169,11 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
|
||||
name="Nominal Power",
|
||||
native_unit_of_measurement=POWER_VOLT_AMPERE,
|
||||
icon="mdi:flash",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.realpower": SensorEntityDescription(
|
||||
key="ups.realpower",
|
||||
name="Current Real Power",
|
||||
native_unit_of_measurement=POWER_WATT,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_POWER,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
@ -228,71 +181,47 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
|
||||
key="ups.realpower.nominal",
|
||||
name="Nominal Real Power",
|
||||
native_unit_of_measurement=POWER_WATT,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_POWER,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.beeper.status": SensorEntityDescription(
|
||||
key="ups.beeper.status",
|
||||
name="Beeper Status",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.type": SensorEntityDescription(
|
||||
key="ups.type",
|
||||
name="UPS Type",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.watchdog.status": SensorEntityDescription(
|
||||
key="ups.watchdog.status",
|
||||
name="Watchdog Status",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.start.auto": SensorEntityDescription(
|
||||
key="ups.start.auto",
|
||||
name="Start on AC",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.start.battery": SensorEntityDescription(
|
||||
key="ups.start.battery",
|
||||
name="Start on Battery",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.start.reboot": SensorEntityDescription(
|
||||
key="ups.start.reboot",
|
||||
name="Reboot on Battery",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ups.shutdown": SensorEntityDescription(
|
||||
key="ups.shutdown",
|
||||
name="Shutdown Ability",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"battery.charge": SensorEntityDescription(
|
||||
key="battery.charge",
|
||||
name="Battery Charge",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_BATTERY,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
@ -301,38 +230,28 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
|
||||
name="Low Battery Setpoint",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:gauge",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"battery.charge.restart": SensorEntityDescription(
|
||||
key="battery.charge.restart",
|
||||
name="Minimum Battery to Start",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:gauge",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"battery.charge.warning": SensorEntityDescription(
|
||||
key="battery.charge.warning",
|
||||
name="Warning Battery Setpoint",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:gauge",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"battery.charger.status": SensorEntityDescription(
|
||||
key="battery.charger.status",
|
||||
name="Charging Status",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"battery.voltage": SensorEntityDescription(
|
||||
key="battery.voltage",
|
||||
name="Battery Voltage",
|
||||
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_VOLTAGE,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
@ -340,40 +259,31 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
|
||||
key="battery.voltage.nominal",
|
||||
name="Nominal Battery Voltage",
|
||||
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_VOLTAGE,
|
||||
state_class=None,
|
||||
),
|
||||
"battery.voltage.low": SensorEntityDescription(
|
||||
key="battery.voltage.low",
|
||||
name="Low Battery Voltage",
|
||||
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_VOLTAGE,
|
||||
state_class=None,
|
||||
),
|
||||
"battery.voltage.high": SensorEntityDescription(
|
||||
key="battery.voltage.high",
|
||||
name="High Battery Voltage",
|
||||
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_VOLTAGE,
|
||||
state_class=None,
|
||||
),
|
||||
"battery.capacity": SensorEntityDescription(
|
||||
key="battery.capacity",
|
||||
name="Battery Capacity",
|
||||
native_unit_of_measurement="Ah",
|
||||
icon="mdi:flash",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"battery.current": SensorEntityDescription(
|
||||
key="battery.current",
|
||||
name="Battery Current",
|
||||
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
|
||||
icon="mdi:flash",
|
||||
device_class=None,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
"battery.current.total": SensorEntityDescription(
|
||||
@ -381,14 +291,11 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
|
||||
name="Total Battery Current",
|
||||
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
|
||||
icon="mdi:flash",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"battery.temperature": SensorEntityDescription(
|
||||
key="battery.temperature",
|
||||
name="Battery Temperature",
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
@ -397,110 +304,75 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
|
||||
name="Battery Runtime",
|
||||
native_unit_of_measurement=TIME_SECONDS,
|
||||
icon="mdi:timer-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"battery.runtime.low": SensorEntityDescription(
|
||||
key="battery.runtime.low",
|
||||
name="Low Battery Runtime",
|
||||
native_unit_of_measurement=TIME_SECONDS,
|
||||
icon="mdi:timer-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"battery.runtime.restart": SensorEntityDescription(
|
||||
key="battery.runtime.restart",
|
||||
name="Minimum Battery Runtime to Start",
|
||||
native_unit_of_measurement=TIME_SECONDS,
|
||||
icon="mdi:timer-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"battery.alarm.threshold": SensorEntityDescription(
|
||||
key="battery.alarm.threshold",
|
||||
name="Battery Alarm Threshold",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"battery.date": SensorEntityDescription(
|
||||
key="battery.date",
|
||||
name="Battery Date",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:calendar",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"battery.mfr.date": SensorEntityDescription(
|
||||
key="battery.mfr.date",
|
||||
name="Battery Manuf. Date",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:calendar",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"battery.packs": SensorEntityDescription(
|
||||
key="battery.packs",
|
||||
name="Number of Batteries",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"battery.packs.bad": SensorEntityDescription(
|
||||
key="battery.packs.bad",
|
||||
name="Number of Bad Batteries",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"battery.type": SensorEntityDescription(
|
||||
key="battery.type",
|
||||
name="Battery Chemistry",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"input.sensitivity": SensorEntityDescription(
|
||||
key="input.sensitivity",
|
||||
name="Input Power Sensitivity",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"input.transfer.low": SensorEntityDescription(
|
||||
key="input.transfer.low",
|
||||
name="Low Voltage Transfer",
|
||||
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_VOLTAGE,
|
||||
state_class=None,
|
||||
),
|
||||
"input.transfer.high": SensorEntityDescription(
|
||||
key="input.transfer.high",
|
||||
name="High Voltage Transfer",
|
||||
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_VOLTAGE,
|
||||
state_class=None,
|
||||
),
|
||||
"input.transfer.reason": SensorEntityDescription(
|
||||
key="input.transfer.reason",
|
||||
name="Voltage Transfer Reason",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"input.voltage": SensorEntityDescription(
|
||||
key="input.voltage",
|
||||
name="Input Voltage",
|
||||
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_VOLTAGE,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
@ -508,16 +380,13 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
|
||||
key="input.voltage.nominal",
|
||||
name="Nominal Input Voltage",
|
||||
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_VOLTAGE,
|
||||
state_class=None,
|
||||
),
|
||||
"input.frequency": SensorEntityDescription(
|
||||
key="input.frequency",
|
||||
name="Input Line Frequency",
|
||||
native_unit_of_measurement=FREQUENCY_HERTZ,
|
||||
icon="mdi:flash",
|
||||
device_class=None,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
"input.frequency.nominal": SensorEntityDescription(
|
||||
@ -525,23 +394,17 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
|
||||
name="Nominal Input Line Frequency",
|
||||
native_unit_of_measurement=FREQUENCY_HERTZ,
|
||||
icon="mdi:flash",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"input.frequency.status": SensorEntityDescription(
|
||||
key="input.frequency.status",
|
||||
name="Input Frequency Status",
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:information-outline",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"output.current": SensorEntityDescription(
|
||||
key="output.current",
|
||||
name="Output Current",
|
||||
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
|
||||
icon="mdi:flash",
|
||||
device_class=None,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
"output.current.nominal": SensorEntityDescription(
|
||||
@ -549,14 +412,11 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
|
||||
name="Nominal Output Current",
|
||||
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
|
||||
icon="mdi:flash",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"output.voltage": SensorEntityDescription(
|
||||
key="output.voltage",
|
||||
name="Output Voltage",
|
||||
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_VOLTAGE,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
@ -564,16 +424,13 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
|
||||
key="output.voltage.nominal",
|
||||
name="Nominal Output Voltage",
|
||||
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_VOLTAGE,
|
||||
state_class=None,
|
||||
),
|
||||
"output.frequency": SensorEntityDescription(
|
||||
key="output.frequency",
|
||||
name="Output Frequency",
|
||||
native_unit_of_measurement=FREQUENCY_HERTZ,
|
||||
icon="mdi:flash",
|
||||
device_class=None,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
"output.frequency.nominal": SensorEntityDescription(
|
||||
@ -581,14 +438,11 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
|
||||
name="Nominal Output Frequency",
|
||||
native_unit_of_measurement=FREQUENCY_HERTZ,
|
||||
icon="mdi:flash",
|
||||
device_class=None,
|
||||
state_class=None,
|
||||
),
|
||||
"ambient.humidity": SensorEntityDescription(
|
||||
key="ambient.humidity",
|
||||
name="Ambient Humidity",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_HUMIDITY,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
@ -596,7 +450,6 @@ SENSOR_TYPES: Final[dict[str, SensorEntityDescription]] = {
|
||||
key="ambient.temperature",
|
||||
name="Ambient Temperature",
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
|
@ -104,6 +104,8 @@ class NUTSensor(CoordinatorEntity, SensorEntity):
|
||||
self._unique_id = unique_id
|
||||
|
||||
self._attr_name = f"{name} {sensor_description.name}"
|
||||
if unique_id is not None:
|
||||
self._attr_unique_id = f"{unique_id}_{sensor_description.key}"
|
||||
|
||||
@property
|
||||
def device_info(self):
|
||||
@ -122,13 +124,6 @@ class NUTSensor(CoordinatorEntity, SensorEntity):
|
||||
device_info["sw_version"] = self._firmware
|
||||
return device_info
|
||||
|
||||
@property
|
||||
def unique_id(self):
|
||||
"""Sensor Unique id."""
|
||||
if not self._unique_id:
|
||||
return None
|
||||
return f"{self._unique_id}_{self.entity_description.key}"
|
||||
|
||||
@property
|
||||
def native_value(self):
|
||||
"""Return entity state from ups."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user