mirror of
https://github.com/home-assistant/core.git
synced 2026-09-25 07:51:46 -05:00
Add more sensors to MikroTik (#178678)
This commit is contained in:
@@ -12,7 +12,9 @@ from homeassistant.components.sensor import (
|
||||
)
|
||||
from homeassistant.const import (
|
||||
EntityCategory,
|
||||
UnitOfElectricCurrent,
|
||||
UnitOfElectricPotential,
|
||||
UnitOfPower,
|
||||
UnitOfRatio,
|
||||
UnitOfTemperature,
|
||||
)
|
||||
@@ -42,6 +44,59 @@ SENSORS: Final = (
|
||||
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||
type=HEALTH,
|
||||
),
|
||||
MikrotikSensorEntityDescription(
|
||||
key="board-temperature1",
|
||||
translation_key="board_temperature",
|
||||
translation_placeholders={"index": "1"},
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||
type=HEALTH,
|
||||
),
|
||||
MikrotikSensorEntityDescription(
|
||||
key="cpu-temperature",
|
||||
translation_key="cpu_temperature",
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||
type=HEALTH,
|
||||
),
|
||||
MikrotikSensorEntityDescription(
|
||||
key="psu1-current",
|
||||
translation_key="psu_current",
|
||||
translation_placeholders={"index": "1"},
|
||||
device_class=SensorDeviceClass.CURRENT,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
||||
type=HEALTH,
|
||||
),
|
||||
MikrotikSensorEntityDescription(
|
||||
key="psu2-current",
|
||||
translation_key="psu_current",
|
||||
translation_placeholders={"index": "2"},
|
||||
device_class=SensorDeviceClass.CURRENT,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
||||
type=HEALTH,
|
||||
),
|
||||
MikrotikSensorEntityDescription(
|
||||
key="psu1-voltage",
|
||||
translation_key="psu_voltage",
|
||||
translation_placeholders={"index": "1"},
|
||||
device_class=SensorDeviceClass.VOLTAGE,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
|
||||
type=HEALTH,
|
||||
),
|
||||
MikrotikSensorEntityDescription(
|
||||
key="psu2-voltage",
|
||||
translation_key="psu_voltage",
|
||||
translation_placeholders={"index": "2"},
|
||||
device_class=SensorDeviceClass.VOLTAGE,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
|
||||
type=HEALTH,
|
||||
),
|
||||
MikrotikSensorEntityDescription(
|
||||
key="voltage",
|
||||
device_class=SensorDeviceClass.VOLTAGE,
|
||||
@@ -49,6 +104,14 @@ SENSORS: Final = (
|
||||
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
|
||||
type=HEALTH,
|
||||
),
|
||||
MikrotikSensorEntityDescription(
|
||||
key="poe-out-consumption",
|
||||
translation_key="poe_out_consumption",
|
||||
device_class=SensorDeviceClass.POWER,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
native_unit_of_measurement=UnitOfPower.WATT,
|
||||
type=HEALTH,
|
||||
),
|
||||
MikrotikSensorEntityDescription(
|
||||
key="cpu-load",
|
||||
translation_key="cpu_load",
|
||||
|
||||
@@ -61,14 +61,29 @@
|
||||
}
|
||||
},
|
||||
"sensor": {
|
||||
"board_temperature": {
|
||||
"name": "Board temperature {index}"
|
||||
},
|
||||
"cpu_load": {
|
||||
"name": "CPU usage"
|
||||
},
|
||||
"cpu_temperature": {
|
||||
"name": "CPU temperature"
|
||||
},
|
||||
"disk_usage": {
|
||||
"name": "Disk usage"
|
||||
},
|
||||
"memory_usage": {
|
||||
"name": "Memory usage"
|
||||
},
|
||||
"poe_out_consumption": {
|
||||
"name": "PoE (out) consumption"
|
||||
},
|
||||
"psu_current": {
|
||||
"name": "PSU {index} current"
|
||||
},
|
||||
"psu_voltage": {
|
||||
"name": "PSU {index} voltage"
|
||||
}
|
||||
},
|
||||
"switch": {
|
||||
|
||||
Reference in New Issue
Block a user