1
0
Fork 0

sensor: Add device metadata

Associating sensor entities with a device improves organization within
the Home Assistant UI.
master
Dustin 2021-05-01 16:42:26 -05:00
parent e26363a4c8
commit 257bac9d86
1 changed files with 11 additions and 0 deletions

View File

@ -27,11 +27,20 @@ AVAILABILITY_TOPIC = f"{TOPIC}/availability"
I2CPORT = 1
SENSOR_ADDR = 0x77
DEVICE = {
"manufacturer": "Dustin C. Hatch",
"name": "RPi Thermostat Display",
"model": "RPi Thermostat Display",
"identifiers": [
os.uname().nodename,
],
}
SENSOR_CONFIG = {
"thermostat_temperature": {
"device_class": "temperature",
"name": "Thermostat Temperature",
"device": DEVICE,
"state_topic": TOPIC,
"availability_topic": AVAILABILITY_TOPIC,
"unit_of_measurement": "°C",
@ -40,6 +49,7 @@ SENSOR_CONFIG = {
"thermostat_pressure": {
"device_class": "pressure",
"name": "Thermostat Pressure",
"device": DEVICE,
"state_topic": TOPIC,
"availability_topic": AVAILABILITY_TOPIC,
"unit_of_measurement": "hPa",
@ -48,6 +58,7 @@ SENSOR_CONFIG = {
"thermostat_humidity": {
"device_class": "humidity",
"name": "Thermostat Humidity",
"device": DEVICE,
"state_topic": TOPIC,
"availability_topic": AVAILABILITY_TOPIC,
"unit_of_measurement": "%",