Fix shelly dimmer current sensor device class (#4385)

fixes https://github.com/esphome/issues/issues/4086
This commit is contained in:
Trevor North 2023-02-06 23:46:06 +00:00 committed by GitHub
parent 1b66fa5004
commit 124ab31f22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,6 +22,7 @@ from esphome.const import (
UNIT_WATT, UNIT_WATT,
DEVICE_CLASS_POWER, DEVICE_CLASS_POWER,
DEVICE_CLASS_VOLTAGE, DEVICE_CLASS_VOLTAGE,
DEVICE_CLASS_CURRENT,
) )
from esphome.core import HexInt, CORE from esphome.core import HexInt, CORE
@ -169,7 +170,7 @@ CONFIG_SCHEMA = (
), ),
cv.Optional(CONF_CURRENT): sensor.sensor_schema( cv.Optional(CONF_CURRENT): sensor.sensor_schema(
unit_of_measurement=UNIT_AMPERE, unit_of_measurement=UNIT_AMPERE,
device_class=DEVICE_CLASS_POWER, device_class=DEVICE_CLASS_CURRENT,
accuracy_decimals=2, accuracy_decimals=2,
), ),
# Change the default gamma_correct setting. # Change the default gamma_correct setting.