Fix default unit for ble_rssi sensor (#3874)

This commit is contained in:
RoboMagus 2022-10-11 01:03:54 +02:00 committed by GitHub
parent 44b335e7e3
commit 45861456f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,7 @@ from esphome.const import (
CONF_MAC_ADDRESS,
DEVICE_CLASS_SIGNAL_STRENGTH,
STATE_CLASS_MEASUREMENT,
UNIT_DECIBEL,
UNIT_DECIBEL_MILLIWATT,
)
DEPENDENCIES = ["esp32_ble_tracker"]
@ -31,7 +31,7 @@ def _validate(config):
CONFIG_SCHEMA = cv.All(
sensor.sensor_schema(
BLERSSISensor,
unit_of_measurement=UNIT_DECIBEL,
unit_of_measurement=UNIT_DECIBEL_MILLIWATT,
accuracy_decimals=0,
device_class=DEVICE_CLASS_SIGNAL_STRENGTH,
state_class=STATE_CLASS_MEASUREMENT,