Fix Freebox Home alarm & improve platform tests (#103475)

* Fix Freebox Home alarm

* Add trigger feature test & fix

* FreeboxCallSensor: Add test for missing coverage of new call

* Use generator

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Add test for arm_home feature (questions about the check)

* Stay focus on alam tests

* can_arm_home ==> if _command_arm_home

* Use one liner for supported_features

* Add idle state

* Fix rebase

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Quentame
2023-11-20 15:01:18 +01:00
committed by GitHub
parent 6d7df5ae13
commit 923c13907c
12 changed files with 186 additions and 151 deletions

View File

@@ -3,7 +3,7 @@ import json
from homeassistant.components.freebox.router import is_json
from .const import DATA_LAN_GET_HOSTS_LIST_MODE_BRIDGE, WIFI_GET_GLOBAL_CONFIG
from .const import DATA_LAN_GET_HOSTS_LIST_MODE_BRIDGE, DATA_WIFI_GET_GLOBAL_CONFIG
async def test_is_json() -> None:
@@ -12,7 +12,7 @@ async def test_is_json() -> None:
# Valid JSON values
assert is_json("{}")
assert is_json('{ "simple":"json" }')
assert is_json(json.dumps(WIFI_GET_GLOBAL_CONFIG))
assert is_json(json.dumps(DATA_WIFI_GET_GLOBAL_CONFIG))
assert is_json(json.dumps(DATA_LAN_GET_HOSTS_LIST_MODE_BRIDGE))
# Not valid JSON values