Add missing unit for signal strength (#40436)
* Added missing unit for signal strength * Added one more unit * Replaced string with variable * Fixed wrong import * Fix import * Replaced string with variable * Fixed wrong import * Apply suggestions from code review * Black * Again a fix :-( * iSort * iSort after merge Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
This commit is contained in:
1 parent
480066ba63
commit
7554c8d6c5
15 files changed
+84
-27
No files matched your search
@@ -4,7 +4,7 @@ Provide a mock sensor platform.
|
||||
Call init before using it in your tests to ensure clean test data.
|
||||
"""
|
||||
import homeassistant.components.sensor as sensor
|
||||
from homeassistant.const import PERCENTAGE, PRESSURE_HPA
|
||||
from homeassistant.const import PERCENTAGE, PRESSURE_HPA, SIGNAL_STRENGTH_DECIBELS
|
||||
|
||||
from tests.common import MockEntity
|
||||
|
||||
@@ -15,7 +15,7 @@ UNITS_OF_MEASUREMENT = {
|
||||
sensor.DEVICE_CLASS_BATTERY: PERCENTAGE, # % of battery that is left
|
||||
sensor.DEVICE_CLASS_HUMIDITY: PERCENTAGE, # % of humidity in the air
|
||||
sensor.DEVICE_CLASS_ILLUMINANCE: "lm", # current light level (lx/lm)
|
||||
sensor.DEVICE_CLASS_SIGNAL_STRENGTH: "dB", # signal strength (dB/dBm)
|
||||
sensor.DEVICE_CLASS_SIGNAL_STRENGTH: SIGNAL_STRENGTH_DECIBELS, # signal strength (dB/dBm)
|
||||
sensor.DEVICE_CLASS_TEMPERATURE: "C", # temperature (C/F)
|
||||
sensor.DEVICE_CLASS_TIMESTAMP: "hh:mm:ss", # timestamp (ISO8601)
|
||||
sensor.DEVICE_CLASS_PRESSURE: PRESSURE_HPA, # pressure (hPa/mbar)
|
||||
|
||||
Reference in new issue
Block a user