mirror of
https://github.com/esphome/esphome.git
synced 2024-11-26 00:48:19 +01:00
Hydreon: Use new device classes water and precipitation_intensity (#3993)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
parent
66a3361e9d
commit
a127e60e1b
1 changed files with 9 additions and 7 deletions
|
@ -6,8 +6,10 @@ from esphome.const import (
|
||||||
CONF_MODEL,
|
CONF_MODEL,
|
||||||
CONF_MOISTURE,
|
CONF_MOISTURE,
|
||||||
CONF_TEMPERATURE,
|
CONF_TEMPERATURE,
|
||||||
DEVICE_CLASS_HUMIDITY,
|
DEVICE_CLASS_PRECIPITATION_INTENSITY,
|
||||||
|
DEVICE_CLASS_PRECIPITATION,
|
||||||
STATE_CLASS_MEASUREMENT,
|
STATE_CLASS_MEASUREMENT,
|
||||||
|
STATE_CLASS_TOTAL_INCREASING,
|
||||||
UNIT_CELSIUS,
|
UNIT_CELSIUS,
|
||||||
ICON_THERMOMETER,
|
ICON_THERMOMETER,
|
||||||
)
|
)
|
||||||
|
@ -70,31 +72,31 @@ CONFIG_SCHEMA = cv.All(
|
||||||
cv.Optional(CONF_ACC): sensor.sensor_schema(
|
cv.Optional(CONF_ACC): sensor.sensor_schema(
|
||||||
unit_of_measurement=UNIT_MILLIMETERS,
|
unit_of_measurement=UNIT_MILLIMETERS,
|
||||||
accuracy_decimals=2,
|
accuracy_decimals=2,
|
||||||
device_class=DEVICE_CLASS_HUMIDITY,
|
device_class=DEVICE_CLASS_PRECIPITATION,
|
||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
),
|
),
|
||||||
cv.Optional(CONF_EVENT_ACC): sensor.sensor_schema(
|
cv.Optional(CONF_EVENT_ACC): sensor.sensor_schema(
|
||||||
unit_of_measurement=UNIT_MILLIMETERS,
|
unit_of_measurement=UNIT_MILLIMETERS,
|
||||||
accuracy_decimals=2,
|
accuracy_decimals=2,
|
||||||
device_class=DEVICE_CLASS_HUMIDITY,
|
device_class=DEVICE_CLASS_PRECIPITATION,
|
||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
),
|
),
|
||||||
cv.Optional(CONF_TOTAL_ACC): sensor.sensor_schema(
|
cv.Optional(CONF_TOTAL_ACC): sensor.sensor_schema(
|
||||||
unit_of_measurement=UNIT_MILLIMETERS,
|
unit_of_measurement=UNIT_MILLIMETERS,
|
||||||
accuracy_decimals=2,
|
accuracy_decimals=2,
|
||||||
device_class=DEVICE_CLASS_HUMIDITY,
|
device_class=DEVICE_CLASS_PRECIPITATION,
|
||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=STATE_CLASS_TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
cv.Optional(CONF_R_INT): sensor.sensor_schema(
|
cv.Optional(CONF_R_INT): sensor.sensor_schema(
|
||||||
unit_of_measurement=UNIT_MILLIMETERS_PER_HOUR,
|
unit_of_measurement=UNIT_MILLIMETERS_PER_HOUR,
|
||||||
accuracy_decimals=2,
|
accuracy_decimals=2,
|
||||||
device_class=DEVICE_CLASS_HUMIDITY,
|
device_class=DEVICE_CLASS_PRECIPITATION_INTENSITY,
|
||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
),
|
),
|
||||||
cv.Optional(CONF_MOISTURE): sensor.sensor_schema(
|
cv.Optional(CONF_MOISTURE): sensor.sensor_schema(
|
||||||
unit_of_measurement=UNIT_INTENSITY,
|
unit_of_measurement=UNIT_INTENSITY,
|
||||||
accuracy_decimals=0,
|
accuracy_decimals=0,
|
||||||
device_class=DEVICE_CLASS_HUMIDITY,
|
device_class=DEVICE_CLASS_PRECIPITATION_INTENSITY,
|
||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
),
|
),
|
||||||
cv.Optional(CONF_TEMPERATURE): sensor.sensor_schema(
|
cv.Optional(CONF_TEMPERATURE): sensor.sensor_schema(
|
||||||
|
|
Loading…
Reference in a new issue