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
@@ -12,7 +12,6 @@ from homeassistant.components.wled.const import (
|
||||
ATTR_MAX_POWER,
|
||||
CURRENT_MA,
|
||||
DOMAIN,
|
||||
SIGNAL_DBM,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
ATTR_DEVICE_CLASS,
|
||||
@@ -20,6 +19,7 @@ from homeassistant.const import (
|
||||
ATTR_UNIT_OF_MEASUREMENT,
|
||||
DATA_BYTES,
|
||||
PERCENTAGE,
|
||||
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.util import dt as dt_util
|
||||
@@ -138,7 +138,10 @@ async def test_sensors(
|
||||
state = hass.states.get("sensor.wled_rgb_light_wifi_rssi")
|
||||
assert state
|
||||
assert state.attributes.get(ATTR_ICON) == "mdi:wifi"
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == SIGNAL_DBM
|
||||
assert (
|
||||
state.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
|
||||
== SIGNAL_STRENGTH_DECIBELS_MILLIWATT
|
||||
)
|
||||
assert state.state == "-62"
|
||||
|
||||
entry = registry.async_get("sensor.wled_rgb_light_wifi_rssi")
|
||||
|
||||
Reference in new issue
Block a user