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:
functionpointer 2023-01-20 01:56:26 +01:00 committed by GitHub
parent 66a3361e9d
commit a127e60e1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(