Added temperature sensor #47

This commit is contained in:
tomaae 2020-05-27 20:04:09 +02:00
parent b53c346dc6
commit 9eff454269
4 changed files with 32 additions and 3 deletions

View file

@ -2,7 +2,12 @@
import logging
from homeassistant.const import CONF_NAME, ATTR_ATTRIBUTION, ATTR_DEVICE_CLASS
from homeassistant.const import (
CONF_NAME,
ATTR_ATTRIBUTION,
ATTR_DEVICE_CLASS,
TEMP_CELSIUS,
)
from homeassistant.core import callback
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
from homeassistant.helpers.dispatcher import async_dispatcher_connect
@ -34,6 +39,15 @@ ATTR_PATH = "data_path"
ATTR_ATTR = "data_attr"
SENSOR_TYPES = {
"system_temperature": {
ATTR_DEVICE_CLASS: None,
ATTR_ICON: "mdi:thermometer",
ATTR_LABEL: "Temperature",
ATTR_UNIT: TEMP_CELSIUS,
ATTR_GROUP: "System",
ATTR_PATH: "health",
ATTR_ATTR: "temperature",
},
"system_cpu-load": {
ATTR_DEVICE_CLASS: None,
ATTR_ICON: "mdi:speedometer",