Change wifi signal strength unit to dBm (#1734)

This commit is contained in:
mbo18 2021-05-05 10:13:14 +02:00 committed by GitHub
parent ffc6fe9ca0
commit f7232b199a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,7 +5,7 @@ from esphome.const import (
CONF_ID, CONF_ID,
DEVICE_CLASS_SIGNAL_STRENGTH, DEVICE_CLASS_SIGNAL_STRENGTH,
ICON_EMPTY, ICON_EMPTY,
UNIT_DECIBEL, UNIT_DECIBEL_MILLIWATT,
) )
DEPENDENCIES = ["wifi"] DEPENDENCIES = ["wifi"]
@ -15,7 +15,9 @@ WiFiSignalSensor = wifi_signal_ns.class_(
) )
CONFIG_SCHEMA = ( CONFIG_SCHEMA = (
sensor.sensor_schema(UNIT_DECIBEL, ICON_EMPTY, 0, DEVICE_CLASS_SIGNAL_STRENGTH) sensor.sensor_schema(
UNIT_DECIBEL_MILLIWATT, ICON_EMPTY, 0, DEVICE_CLASS_SIGNAL_STRENGTH
)
.extend( .extend(
{ {
cv.GenerateID(): cv.declare_id(WiFiSignalSensor), cv.GenerateID(): cv.declare_id(WiFiSignalSensor),