Use new enums in huisbaasje (#61776)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
b7c0b21c6c
commit
eddc1ae0ed
3 changed files with 60 additions and 59 deletions
|
@ -8,15 +8,8 @@ from huisbaasje.const import (
|
|||
SOURCE_TYPE_GAS,
|
||||
)
|
||||
|
||||
from homeassistant.components.sensor import STATE_CLASS_TOTAL_INCREASING
|
||||
from homeassistant.const import (
|
||||
DEVICE_CLASS_ENERGY,
|
||||
DEVICE_CLASS_GAS,
|
||||
DEVICE_CLASS_POWER,
|
||||
ENERGY_KILO_WATT_HOUR,
|
||||
TIME_HOURS,
|
||||
VOLUME_CUBIC_METERS,
|
||||
)
|
||||
from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass
|
||||
from homeassistant.const import ENERGY_KILO_WATT_HOUR, TIME_HOURS, VOLUME_CUBIC_METERS
|
||||
|
||||
DATA_COORDINATOR = "coordinator"
|
||||
|
||||
|
@ -48,68 +41,68 @@ SOURCE_TYPES = [
|
|||
SENSORS_INFO = [
|
||||
{
|
||||
"name": "Huisbaasje Current Power",
|
||||
"device_class": DEVICE_CLASS_POWER,
|
||||
"device_class": SensorDeviceClass.POWER,
|
||||
"source_type": SOURCE_TYPE_ELECTRICITY,
|
||||
},
|
||||
{
|
||||
"name": "Huisbaasje Current Power In Peak",
|
||||
"device_class": DEVICE_CLASS_POWER,
|
||||
"device_class": SensorDeviceClass.POWER,
|
||||
"source_type": SOURCE_TYPE_ELECTRICITY_IN,
|
||||
},
|
||||
{
|
||||
"name": "Huisbaasje Current Power In Off Peak",
|
||||
"device_class": DEVICE_CLASS_POWER,
|
||||
"device_class": SensorDeviceClass.POWER,
|
||||
"source_type": SOURCE_TYPE_ELECTRICITY_IN_LOW,
|
||||
},
|
||||
{
|
||||
"name": "Huisbaasje Current Power Out Peak",
|
||||
"device_class": DEVICE_CLASS_POWER,
|
||||
"device_class": SensorDeviceClass.POWER,
|
||||
"source_type": SOURCE_TYPE_ELECTRICITY_OUT,
|
||||
},
|
||||
{
|
||||
"name": "Huisbaasje Current Power Out Off Peak",
|
||||
"device_class": DEVICE_CLASS_POWER,
|
||||
"device_class": SensorDeviceClass.POWER,
|
||||
"source_type": SOURCE_TYPE_ELECTRICITY_OUT_LOW,
|
||||
},
|
||||
{
|
||||
"name": "Huisbaasje Energy Consumption Peak Today",
|
||||
"device_class": DEVICE_CLASS_ENERGY,
|
||||
"device_class": SensorDeviceClass.ENERGY,
|
||||
"unit_of_measurement": ENERGY_KILO_WATT_HOUR,
|
||||
"source_type": SOURCE_TYPE_ELECTRICITY_IN,
|
||||
"sensor_type": SENSOR_TYPE_THIS_DAY,
|
||||
"state_class": STATE_CLASS_TOTAL_INCREASING,
|
||||
"state_class": SensorStateClass.TOTAL_INCREASING,
|
||||
"precision": 3,
|
||||
},
|
||||
{
|
||||
"name": "Huisbaasje Energy Consumption Off Peak Today",
|
||||
"device_class": DEVICE_CLASS_ENERGY,
|
||||
"device_class": SensorDeviceClass.ENERGY,
|
||||
"unit_of_measurement": ENERGY_KILO_WATT_HOUR,
|
||||
"source_type": SOURCE_TYPE_ELECTRICITY_IN_LOW,
|
||||
"sensor_type": SENSOR_TYPE_THIS_DAY,
|
||||
"state_class": STATE_CLASS_TOTAL_INCREASING,
|
||||
"state_class": SensorStateClass.TOTAL_INCREASING,
|
||||
"precision": 3,
|
||||
},
|
||||
{
|
||||
"name": "Huisbaasje Energy Production Peak Today",
|
||||
"device_class": DEVICE_CLASS_ENERGY,
|
||||
"device_class": SensorDeviceClass.ENERGY,
|
||||
"unit_of_measurement": ENERGY_KILO_WATT_HOUR,
|
||||
"source_type": SOURCE_TYPE_ELECTRICITY_OUT,
|
||||
"sensor_type": SENSOR_TYPE_THIS_DAY,
|
||||
"state_class": STATE_CLASS_TOTAL_INCREASING,
|
||||
"state_class": SensorStateClass.TOTAL_INCREASING,
|
||||
"precision": 3,
|
||||
},
|
||||
{
|
||||
"name": "Huisbaasje Energy Production Off Peak Today",
|
||||
"device_class": DEVICE_CLASS_ENERGY,
|
||||
"device_class": SensorDeviceClass.ENERGY,
|
||||
"unit_of_measurement": ENERGY_KILO_WATT_HOUR,
|
||||
"source_type": SOURCE_TYPE_ELECTRICITY_OUT_LOW,
|
||||
"sensor_type": SENSOR_TYPE_THIS_DAY,
|
||||
"state_class": STATE_CLASS_TOTAL_INCREASING,
|
||||
"state_class": SensorStateClass.TOTAL_INCREASING,
|
||||
"precision": 3,
|
||||
},
|
||||
{
|
||||
"name": "Huisbaasje Energy Today",
|
||||
"device_class": DEVICE_CLASS_ENERGY,
|
||||
"device_class": SensorDeviceClass.ENERGY,
|
||||
"unit_of_measurement": ENERGY_KILO_WATT_HOUR,
|
||||
"source_type": SOURCE_TYPE_ELECTRICITY,
|
||||
"sensor_type": SENSOR_TYPE_THIS_DAY,
|
||||
|
@ -117,7 +110,7 @@ SENSORS_INFO = [
|
|||
},
|
||||
{
|
||||
"name": "Huisbaasje Energy This Week",
|
||||
"device_class": DEVICE_CLASS_ENERGY,
|
||||
"device_class": SensorDeviceClass.ENERGY,
|
||||
"unit_of_measurement": ENERGY_KILO_WATT_HOUR,
|
||||
"source_type": SOURCE_TYPE_ELECTRICITY,
|
||||
"sensor_type": SENSOR_TYPE_THIS_WEEK,
|
||||
|
@ -125,7 +118,7 @@ SENSORS_INFO = [
|
|||
},
|
||||
{
|
||||
"name": "Huisbaasje Energy This Month",
|
||||
"device_class": DEVICE_CLASS_ENERGY,
|
||||
"device_class": SensorDeviceClass.ENERGY,
|
||||
"unit_of_measurement": ENERGY_KILO_WATT_HOUR,
|
||||
"source_type": SOURCE_TYPE_ELECTRICITY,
|
||||
"sensor_type": SENSOR_TYPE_THIS_MONTH,
|
||||
|
@ -133,7 +126,7 @@ SENSORS_INFO = [
|
|||
},
|
||||
{
|
||||
"name": "Huisbaasje Energy This Year",
|
||||
"device_class": DEVICE_CLASS_ENERGY,
|
||||
"device_class": SensorDeviceClass.ENERGY,
|
||||
"unit_of_measurement": ENERGY_KILO_WATT_HOUR,
|
||||
"source_type": SOURCE_TYPE_ELECTRICITY,
|
||||
"sensor_type": SENSOR_TYPE_THIS_YEAR,
|
||||
|
@ -148,41 +141,41 @@ SENSORS_INFO = [
|
|||
},
|
||||
{
|
||||
"name": "Huisbaasje Gas Today",
|
||||
"device_class": DEVICE_CLASS_GAS,
|
||||
"device_class": SensorDeviceClass.GAS,
|
||||
"unit_of_measurement": VOLUME_CUBIC_METERS,
|
||||
"source_type": SOURCE_TYPE_GAS,
|
||||
"sensor_type": SENSOR_TYPE_THIS_DAY,
|
||||
"state_class": STATE_CLASS_TOTAL_INCREASING,
|
||||
"state_class": SensorStateClass.TOTAL_INCREASING,
|
||||
"icon": "mdi:counter",
|
||||
"precision": 1,
|
||||
},
|
||||
{
|
||||
"name": "Huisbaasje Gas This Week",
|
||||
"device_class": DEVICE_CLASS_GAS,
|
||||
"device_class": SensorDeviceClass.GAS,
|
||||
"unit_of_measurement": VOLUME_CUBIC_METERS,
|
||||
"source_type": SOURCE_TYPE_GAS,
|
||||
"sensor_type": SENSOR_TYPE_THIS_WEEK,
|
||||
"state_class": STATE_CLASS_TOTAL_INCREASING,
|
||||
"state_class": SensorStateClass.TOTAL_INCREASING,
|
||||
"icon": "mdi:counter",
|
||||
"precision": 1,
|
||||
},
|
||||
{
|
||||
"name": "Huisbaasje Gas This Month",
|
||||
"device_class": DEVICE_CLASS_GAS,
|
||||
"device_class": SensorDeviceClass.GAS,
|
||||
"unit_of_measurement": VOLUME_CUBIC_METERS,
|
||||
"source_type": SOURCE_TYPE_GAS,
|
||||
"sensor_type": SENSOR_TYPE_THIS_MONTH,
|
||||
"state_class": STATE_CLASS_TOTAL_INCREASING,
|
||||
"state_class": SensorStateClass.TOTAL_INCREASING,
|
||||
"icon": "mdi:counter",
|
||||
"precision": 1,
|
||||
},
|
||||
{
|
||||
"name": "Huisbaasje Gas This Year",
|
||||
"device_class": DEVICE_CLASS_GAS,
|
||||
"device_class": SensorDeviceClass.GAS,
|
||||
"unit_of_measurement": VOLUME_CUBIC_METERS,
|
||||
"source_type": SOURCE_TYPE_GAS,
|
||||
"sensor_type": SENSOR_TYPE_THIS_YEAR,
|
||||
"state_class": STATE_CLASS_TOTAL_INCREASING,
|
||||
"state_class": SensorStateClass.TOTAL_INCREASING,
|
||||
"icon": "mdi:counter",
|
||||
"precision": 1,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue