Add icon translations to apcupsd (#111342)
* Add icon translations to apcupsd * Add icon translations to apcupsd
This commit is contained in:
parent
cb6cf3bedc
commit
859c28fdb7
3 changed files with 205 additions and 53 deletions
|
@ -19,7 +19,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
_DESCRIPTION = BinarySensorEntityDescription(
|
||||
key="statflag",
|
||||
name="UPS Online Status",
|
||||
icon="mdi:heart",
|
||||
translation_key="online_status",
|
||||
)
|
||||
# The bit in STATFLAG that indicates the online status of the APC UPS.
|
||||
_VALUE_ONLINE_MASK: Final = 0b1000
|
||||
|
|
155
homeassistant/components/apcupsd/icons.json
Normal file
155
homeassistant/components/apcupsd/icons.json
Normal file
|
@ -0,0 +1,155 @@
|
|||
{
|
||||
"entity": {
|
||||
"binary_sensor": {
|
||||
"online_status": {
|
||||
"default": "mdi:heart"
|
||||
}
|
||||
},
|
||||
"sensor": {
|
||||
"alarm_delay": {
|
||||
"default": "mdi:alarm"
|
||||
},
|
||||
"apc_status": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"apc_model": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"bad_batteries": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"battery_replacement_date": {
|
||||
"default": "mdi:calendar-clock"
|
||||
},
|
||||
"battery_status": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"cable_type": {
|
||||
"default": "mdi:ethernet-cable"
|
||||
},
|
||||
"total_time_on_battery": {
|
||||
"default": "mdi:timer-outline"
|
||||
},
|
||||
"date": {
|
||||
"default": "mdi:calendar-clock"
|
||||
},
|
||||
"dip_switch_settings": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"low_battery_signal": {
|
||||
"default": "mdi:clock-alert"
|
||||
},
|
||||
"driver": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"shutdown_delay": {
|
||||
"default": "mdi:timer-outline"
|
||||
},
|
||||
"wake_delay": {
|
||||
"default": "mdi:timer-outline"
|
||||
},
|
||||
"date_and_time": {
|
||||
"default": "mdi:calendar-clock"
|
||||
},
|
||||
"external_batteries": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"firmware_version": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"hostname": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"last_self_test": {
|
||||
"default": "mdi:calendar-clock"
|
||||
},
|
||||
"last_transfer": {
|
||||
"default": "mdi:transfer"
|
||||
},
|
||||
"line_failure": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"load_capacity": {
|
||||
"default": "mdi:gauge"
|
||||
},
|
||||
"apparent_power": {
|
||||
"default": "mdi:gauge"
|
||||
},
|
||||
"manufacture_date": {
|
||||
"default": "mdi:calendar"
|
||||
},
|
||||
"master_update": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"max_time": {
|
||||
"default": "mdi:timer-off-outline"
|
||||
},
|
||||
"max_battery_charge": {
|
||||
"default": "mdi:battery-alert"
|
||||
},
|
||||
"min_time": {
|
||||
"default": "mdi:timer-outline"
|
||||
},
|
||||
"model": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"transfer_count": {
|
||||
"default": "mdi:counter"
|
||||
},
|
||||
"register_1_fault": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"register_2_fault": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"register_3_fault": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"restore_capacity": {
|
||||
"default": "mdi:battery-alert"
|
||||
},
|
||||
"self_test_result": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"sensitivity": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"serial_number": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"startup_time": {
|
||||
"default": "mdi:calendar-clock"
|
||||
},
|
||||
"online_status": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"status": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"self_test_interval": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"time_left": {
|
||||
"default": "mdi:clock-alert"
|
||||
},
|
||||
"time_on_battery": {
|
||||
"default": "mdi:timer-outline"
|
||||
},
|
||||
"ups_mode": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"ups_name": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"version": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"transfer_from_battery": {
|
||||
"default": "mdi:transfer"
|
||||
},
|
||||
"transfer_to_battery": {
|
||||
"default": "mdi:transfer"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -31,43 +31,42 @@ _LOGGER = logging.getLogger(__name__)
|
|||
SENSORS: dict[str, SensorEntityDescription] = {
|
||||
"alarmdel": SensorEntityDescription(
|
||||
key="alarmdel",
|
||||
translation_key="alarm_delay",
|
||||
name="UPS Alarm Delay",
|
||||
icon="mdi:alarm",
|
||||
),
|
||||
"ambtemp": SensorEntityDescription(
|
||||
key="ambtemp",
|
||||
name="UPS Ambient Temperature",
|
||||
icon="mdi:thermometer",
|
||||
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
"apc": SensorEntityDescription(
|
||||
key="apc",
|
||||
translation_key="apc_status",
|
||||
name="UPS Status Data",
|
||||
icon="mdi:information-outline",
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"apcmodel": SensorEntityDescription(
|
||||
key="apcmodel",
|
||||
translation_key="apc_model",
|
||||
name="UPS Model",
|
||||
icon="mdi:information-outline",
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"badbatts": SensorEntityDescription(
|
||||
key="badbatts",
|
||||
translation_key="bad_batteries",
|
||||
name="UPS Bad Batteries",
|
||||
icon="mdi:information-outline",
|
||||
),
|
||||
"battdate": SensorEntityDescription(
|
||||
key="battdate",
|
||||
translation_key="battery_replacement_date",
|
||||
name="UPS Battery Replaced",
|
||||
icon="mdi:calendar-clock",
|
||||
),
|
||||
"battstat": SensorEntityDescription(
|
||||
key="battstat",
|
||||
translation_key="battery_status",
|
||||
name="UPS Battery Status",
|
||||
icon="mdi:information-outline",
|
||||
),
|
||||
"battv": SensorEntityDescription(
|
||||
key="battv",
|
||||
|
@ -80,69 +79,68 @@ SENSORS: dict[str, SensorEntityDescription] = {
|
|||
key="bcharge",
|
||||
name="UPS Battery",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:battery",
|
||||
device_class=SensorDeviceClass.BATTERY,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
"cable": SensorEntityDescription(
|
||||
key="cable",
|
||||
translation_key="cable_type",
|
||||
name="UPS Cable Type",
|
||||
icon="mdi:ethernet-cable",
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"cumonbatt": SensorEntityDescription(
|
||||
key="cumonbatt",
|
||||
translation_key="total_time_on_battery",
|
||||
name="UPS Total Time on Battery",
|
||||
icon="mdi:timer-outline",
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
),
|
||||
"date": SensorEntityDescription(
|
||||
key="date",
|
||||
translation_key="date",
|
||||
name="UPS Status Date",
|
||||
icon="mdi:calendar-clock",
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"dipsw": SensorEntityDescription(
|
||||
key="dipsw",
|
||||
translation_key="dip_switch_settings",
|
||||
name="UPS Dip Switch Settings",
|
||||
icon="mdi:information-outline",
|
||||
),
|
||||
"dlowbatt": SensorEntityDescription(
|
||||
key="dlowbatt",
|
||||
translation_key="low_battery_signal",
|
||||
name="UPS Low Battery Signal",
|
||||
icon="mdi:clock-alert",
|
||||
),
|
||||
"driver": SensorEntityDescription(
|
||||
key="driver",
|
||||
translation_key="driver",
|
||||
name="UPS Driver",
|
||||
icon="mdi:information-outline",
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"dshutd": SensorEntityDescription(
|
||||
key="dshutd",
|
||||
translation_key="shutdown_delay",
|
||||
name="UPS Shutdown Delay",
|
||||
icon="mdi:timer-outline",
|
||||
),
|
||||
"dwake": SensorEntityDescription(
|
||||
key="dwake",
|
||||
translation_key="wake_delay",
|
||||
name="UPS Wake Delay",
|
||||
icon="mdi:timer-outline",
|
||||
),
|
||||
"end apc": SensorEntityDescription(
|
||||
key="end apc",
|
||||
translation_key="date_and_time",
|
||||
name="UPS Date and Time",
|
||||
icon="mdi:calendar-clock",
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"extbatts": SensorEntityDescription(
|
||||
key="extbatts",
|
||||
translation_key="external_batteries",
|
||||
name="UPS External Batteries",
|
||||
icon="mdi:information-outline",
|
||||
),
|
||||
"firmware": SensorEntityDescription(
|
||||
key="firmware",
|
||||
translation_key="firmware_version",
|
||||
name="UPS Firmware Version",
|
||||
icon="mdi:information-outline",
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"hitrans": SensorEntityDescription(
|
||||
|
@ -153,8 +151,8 @@ SENSORS: dict[str, SensorEntityDescription] = {
|
|||
),
|
||||
"hostname": SensorEntityDescription(
|
||||
key="hostname",
|
||||
translation_key="hostname",
|
||||
name="UPS Hostname",
|
||||
icon="mdi:information-outline",
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"humidity": SensorEntityDescription(
|
||||
|
@ -162,7 +160,6 @@ SENSORS: dict[str, SensorEntityDescription] = {
|
|||
name="UPS Ambient Humidity",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
device_class=SensorDeviceClass.HUMIDITY,
|
||||
icon="mdi:water-percent",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
"itemp": SensorEntityDescription(
|
||||
|
@ -174,19 +171,19 @@ SENSORS: dict[str, SensorEntityDescription] = {
|
|||
),
|
||||
"laststest": SensorEntityDescription(
|
||||
key="laststest",
|
||||
translation_key="last_self_test",
|
||||
name="UPS Last Self Test",
|
||||
icon="mdi:calendar-clock",
|
||||
),
|
||||
"lastxfer": SensorEntityDescription(
|
||||
key="lastxfer",
|
||||
translation_key="last_transfer",
|
||||
name="UPS Last Transfer",
|
||||
icon="mdi:transfer",
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"linefail": SensorEntityDescription(
|
||||
key="linefail",
|
||||
translation_key="line_failure",
|
||||
name="UPS Input Voltage Status",
|
||||
icon="mdi:information-outline",
|
||||
),
|
||||
"linefreq": SensorEntityDescription(
|
||||
key="linefreq",
|
||||
|
@ -204,16 +201,16 @@ SENSORS: dict[str, SensorEntityDescription] = {
|
|||
),
|
||||
"loadpct": SensorEntityDescription(
|
||||
key="loadpct",
|
||||
translation_key="load_capacity",
|
||||
name="UPS Load",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:gauge",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
"loadapnt": SensorEntityDescription(
|
||||
key="loadapnt",
|
||||
translation_key="apparent_power",
|
||||
name="UPS Load Apparent Power",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:gauge",
|
||||
),
|
||||
"lotrans": SensorEntityDescription(
|
||||
key="lotrans",
|
||||
|
@ -223,14 +220,14 @@ SENSORS: dict[str, SensorEntityDescription] = {
|
|||
),
|
||||
"mandate": SensorEntityDescription(
|
||||
key="mandate",
|
||||
translation_key="manufacture_date",
|
||||
name="UPS Manufacture Date",
|
||||
icon="mdi:calendar",
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"masterupd": SensorEntityDescription(
|
||||
key="masterupd",
|
||||
translation_key="master_update",
|
||||
name="UPS Master Update",
|
||||
icon="mdi:information-outline",
|
||||
),
|
||||
"maxlinev": SensorEntityDescription(
|
||||
key="maxlinev",
|
||||
|
@ -240,14 +237,14 @@ SENSORS: dict[str, SensorEntityDescription] = {
|
|||
),
|
||||
"maxtime": SensorEntityDescription(
|
||||
key="maxtime",
|
||||
translation_key="max_time",
|
||||
name="UPS Battery Timeout",
|
||||
icon="mdi:timer-off-outline",
|
||||
),
|
||||
"mbattchg": SensorEntityDescription(
|
||||
key="mbattchg",
|
||||
translation_key="max_battery_charge",
|
||||
name="UPS Battery Shutdown",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:battery-alert",
|
||||
),
|
||||
"minlinev": SensorEntityDescription(
|
||||
key="minlinev",
|
||||
|
@ -257,13 +254,13 @@ SENSORS: dict[str, SensorEntityDescription] = {
|
|||
),
|
||||
"mintimel": SensorEntityDescription(
|
||||
key="mintimel",
|
||||
translation_key="min_time",
|
||||
name="UPS Shutdown Time",
|
||||
icon="mdi:timer-outline",
|
||||
),
|
||||
"model": SensorEntityDescription(
|
||||
key="model",
|
||||
translation_key="model",
|
||||
name="UPS Model",
|
||||
icon="mdi:information-outline",
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"nombattv": SensorEntityDescription(
|
||||
|
@ -298,8 +295,8 @@ SENSORS: dict[str, SensorEntityDescription] = {
|
|||
),
|
||||
"numxfers": SensorEntityDescription(
|
||||
key="numxfers",
|
||||
translation_key="transfer_count",
|
||||
name="UPS Transfer Count",
|
||||
icon="mdi:counter",
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
),
|
||||
"outcurnt": SensorEntityDescription(
|
||||
|
@ -318,109 +315,109 @@ SENSORS: dict[str, SensorEntityDescription] = {
|
|||
),
|
||||
"reg1": SensorEntityDescription(
|
||||
key="reg1",
|
||||
translation_key="register_1_fault",
|
||||
name="UPS Register 1 Fault",
|
||||
icon="mdi:information-outline",
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"reg2": SensorEntityDescription(
|
||||
key="reg2",
|
||||
translation_key="register_2_fault",
|
||||
name="UPS Register 2 Fault",
|
||||
icon="mdi:information-outline",
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"reg3": SensorEntityDescription(
|
||||
key="reg3",
|
||||
translation_key="register_3_fault",
|
||||
name="UPS Register 3 Fault",
|
||||
icon="mdi:information-outline",
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"retpct": SensorEntityDescription(
|
||||
key="retpct",
|
||||
translation_key="restore_capacity",
|
||||
name="UPS Restore Requirement",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:battery-alert",
|
||||
),
|
||||
"selftest": SensorEntityDescription(
|
||||
key="selftest",
|
||||
translation_key="self_test_result",
|
||||
name="UPS Self Test result",
|
||||
icon="mdi:information-outline",
|
||||
),
|
||||
"sense": SensorEntityDescription(
|
||||
key="sense",
|
||||
translation_key="sensitivity",
|
||||
name="UPS Sensitivity",
|
||||
icon="mdi:information-outline",
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"serialno": SensorEntityDescription(
|
||||
key="serialno",
|
||||
translation_key="serial_number",
|
||||
name="UPS Serial Number",
|
||||
icon="mdi:information-outline",
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"starttime": SensorEntityDescription(
|
||||
key="starttime",
|
||||
translation_key="startup_time",
|
||||
name="UPS Startup Time",
|
||||
icon="mdi:calendar-clock",
|
||||
),
|
||||
"statflag": SensorEntityDescription(
|
||||
key="statflag",
|
||||
translation_key="online_status",
|
||||
name="UPS Status Flag",
|
||||
icon="mdi:information-outline",
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"status": SensorEntityDescription(
|
||||
key="status",
|
||||
translation_key="status",
|
||||
name="UPS Status",
|
||||
icon="mdi:information-outline",
|
||||
),
|
||||
"stesti": SensorEntityDescription(
|
||||
key="stesti",
|
||||
translation_key="self_test_interval",
|
||||
name="UPS Self Test Interval",
|
||||
icon="mdi:information-outline",
|
||||
),
|
||||
"timeleft": SensorEntityDescription(
|
||||
key="timeleft",
|
||||
translation_key="time_left",
|
||||
name="UPS Time Left",
|
||||
icon="mdi:clock-alert",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
"tonbatt": SensorEntityDescription(
|
||||
key="tonbatt",
|
||||
translation_key="time_on_battery",
|
||||
name="UPS Time on Battery",
|
||||
icon="mdi:timer-outline",
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
),
|
||||
"upsmode": SensorEntityDescription(
|
||||
key="upsmode",
|
||||
translation_key="ups_mode",
|
||||
name="UPS Mode",
|
||||
icon="mdi:information-outline",
|
||||
),
|
||||
"upsname": SensorEntityDescription(
|
||||
key="upsname",
|
||||
translation_key="ups_name",
|
||||
name="UPS Name",
|
||||
icon="mdi:information-outline",
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"version": SensorEntityDescription(
|
||||
key="version",
|
||||
translation_key="version",
|
||||
name="UPS Daemon Info",
|
||||
icon="mdi:information-outline",
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"xoffbat": SensorEntityDescription(
|
||||
key="xoffbat",
|
||||
translation_key="transfer_from_battery",
|
||||
name="UPS Transfer from Battery",
|
||||
icon="mdi:transfer",
|
||||
),
|
||||
"xoffbatt": SensorEntityDescription(
|
||||
key="xoffbatt",
|
||||
translation_key="transfer_from_battery",
|
||||
name="UPS Transfer from Battery",
|
||||
icon="mdi:transfer",
|
||||
),
|
||||
"xonbatt": SensorEntityDescription(
|
||||
key="xonbatt",
|
||||
translation_key="transfer_to_battery",
|
||||
name="UPS Transfer to Battery",
|
||||
icon="mdi:transfer",
|
||||
),
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue