mirror of
https://github.com/elisspace/core.git
synced 2026-09-29 22:09:55 +00:00
Move calculation of current value into lib in Fritz!SmartHome (#89150)
This commit is contained in:
@@ -129,6 +129,7 @@ class FritzDeviceSwitchMock(FritzEntityBaseMock):
|
||||
device_lock = "fake_locked_device"
|
||||
energy = 1234
|
||||
voltage = 230000
|
||||
current = 25
|
||||
fw_version = "1.2.3"
|
||||
has_alarm = False
|
||||
has_powermeter = True
|
||||
|
||||
@@ -174,21 +174,3 @@ async def test_assume_device_unavailable(hass: HomeAssistant, fritz: Mock) -> No
|
||||
state = hass.states.get(ENTITY_ID)
|
||||
assert state
|
||||
assert state.state == STATE_UNAVAILABLE
|
||||
|
||||
|
||||
async def test_device_current_unavailable(hass: HomeAssistant, fritz: Mock) -> None:
|
||||
"""Test current in case voltage and power are not available."""
|
||||
device = FritzDeviceSwitchMock()
|
||||
device.voltage = None
|
||||
device.power = None
|
||||
assert await setup_config_entry(
|
||||
hass, MOCK_CONFIG[FB_DOMAIN][CONF_DEVICES][0], ENTITY_ID, device, fritz
|
||||
)
|
||||
|
||||
state = hass.states.get(ENTITY_ID)
|
||||
assert state
|
||||
assert state.state == STATE_ON
|
||||
|
||||
state = hass.states.get(f"{SENSOR_DOMAIN}.{CONF_FAKE_NAME}_electric_current")
|
||||
assert state
|
||||
assert state.state == "0.0"
|
||||
|
||||
Reference in New Issue
Block a user