From f7232b199a33dca9e863f88134ae8b7849bb1b93 Mon Sep 17 00:00:00 2001 From: mbo18 Date: Wed, 5 May 2021 10:13:14 +0200 Subject: [PATCH] Change wifi signal strength unit to dBm (#1734) --- esphome/components/wifi_signal/sensor.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/esphome/components/wifi_signal/sensor.py b/esphome/components/wifi_signal/sensor.py index f2a9f5408c..891d95d33e 100644 --- a/esphome/components/wifi_signal/sensor.py +++ b/esphome/components/wifi_signal/sensor.py @@ -5,7 +5,7 @@ from esphome.const import ( CONF_ID, DEVICE_CLASS_SIGNAL_STRENGTH, ICON_EMPTY, - UNIT_DECIBEL, + UNIT_DECIBEL_MILLIWATT, ) DEPENDENCIES = ["wifi"] @@ -15,7 +15,9 @@ WiFiSignalSensor = wifi_signal_ns.class_( ) 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( { cv.GenerateID(): cv.declare_id(WiFiSignalSensor),