parent
c075dac916
commit
89355e0879
|
@ -128,6 +128,13 @@ SENSORS: tuple[WLEDSensorEntityDescription, ...] = (
|
|||
entity_registry_enabled_default=False,
|
||||
value_fn=lambda device: device.info.wifi.bssid if device.info.wifi else None,
|
||||
),
|
||||
WLEDSensorEntityDescription(
|
||||
key="ip",
|
||||
name="IP",
|
||||
icon="mdi:ip-network",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=lambda device: device.info.ip,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -86,7 +86,8 @@
|
|||
"brand": "WLED",
|
||||
"product": "DIY light",
|
||||
"btype": "bin",
|
||||
"mac": "aabbccddeeff"
|
||||
"mac": "aabbccddeeff",
|
||||
"ip": "127.0.0.1"
|
||||
},
|
||||
"effects": [
|
||||
"Solid",
|
||||
|
|
|
@ -86,7 +86,8 @@
|
|||
"brand": "WLED",
|
||||
"product": "DIY light",
|
||||
"btype": "bin",
|
||||
"mac": "aabbccddeeff"
|
||||
"mac": "aabbccddeeff",
|
||||
"ip": "127.0.0.1"
|
||||
},
|
||||
"effects": [
|
||||
"Solid",
|
||||
|
|
|
@ -68,7 +68,8 @@
|
|||
"brand": "WLED",
|
||||
"product": "DIY light",
|
||||
"btype": "bin",
|
||||
"mac": "aabbccddeeff"
|
||||
"mac": "aabbccddeeff",
|
||||
"ip": "127.0.0.1"
|
||||
},
|
||||
"effects": [
|
||||
"Solid",
|
||||
|
|
|
@ -94,7 +94,8 @@
|
|||
"opt": 127,
|
||||
"brand": "WLED",
|
||||
"product": "FOSS",
|
||||
"mac": "aabbccddeeff"
|
||||
"mac": "aabbccddeeff",
|
||||
"ip": "127.0.0.1"
|
||||
},
|
||||
"effects": [
|
||||
"Solid",
|
||||
|
|
|
@ -68,7 +68,8 @@
|
|||
"brand": "WLED",
|
||||
"product": "DIY light",
|
||||
"btype": "bin",
|
||||
"mac": "aabbccddee11"
|
||||
"mac": "aabbccddee11",
|
||||
"ip": "127.0.0.1"
|
||||
},
|
||||
"effects": [
|
||||
"Solid",
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
'effect_count': 81,
|
||||
'filesystem': None,
|
||||
'free_heap': 14600,
|
||||
'ip': 'Unknown',
|
||||
'ip': '127.0.0.1',
|
||||
'leds': dict({
|
||||
'__type': "<class 'wled.models.Leds'>",
|
||||
'repr': 'Leds(cct=False, count=30, fps=None, light_capabilities=None, max_power=850, max_segments=10, power=470, rgbw=False, wv=True, segment_light_capabilities=None)',
|
||||
|
|
|
@ -110,6 +110,15 @@ async def test_sensors(
|
|||
assert entry.unique_id == "aabbccddeeff_wifi_bssid"
|
||||
assert entry.entity_category is EntityCategory.DIAGNOSTIC
|
||||
|
||||
assert (state := hass.states.get("sensor.wled_rgb_light_ip"))
|
||||
assert state.attributes.get(ATTR_ICON) == "mdi:ip-network"
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) is None
|
||||
assert state.state == "127.0.0.1"
|
||||
|
||||
assert (entry := entity_registry.async_get("sensor.wled_rgb_light_ip"))
|
||||
assert entry.unique_id == "aabbccddeeff_ip"
|
||||
assert entry.entity_category is EntityCategory.DIAGNOSTIC
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"entity_id",
|
||||
|
|
Loading…
Reference in New Issue