Add SFR Box integration#84780
Conversation
|
Thanks @Kane610 👍 |
| "No Defect", | ||
| "Of Frame", | ||
| "Loss Of Signal", | ||
| "Loss Of Power", | ||
| "Loss Of Signal Quality", | ||
| "Unknown", |
There was a problem hiding this comment.
These should be lower case and been put into translations.
| "Idle", | ||
| "G.994 Training", | ||
| "G.992 Started", | ||
| "G.922 Channel Analysis", | ||
| "G.992 Message Exchange", | ||
| "G.993 Started", | ||
| "G.993 Channel Analysis", | ||
| "G.993 Message Exchange", | ||
| "Showtime", | ||
| "Unknown", |
| SFRBoxSensor(data["dsl_coordinator"], description, system_info) | ||
| for description in SENSOR_TYPES | ||
| ] | ||
| async_add_entities(entities, True) |
There was a problem hiding this comment.
This is a coordinator that already has data, the True parameter seems unneeded here.
There was a problem hiding this comment.
The coordinator doesn't yet have data, at is it not (currently) initialised on setup.
I will address this when I add the second coordinator.
| try: | ||
| system_info = await box.system_get_info() | ||
| except SFRBoxError as err: | ||
| raise ConfigEntryNotReady( | ||
| f"Unable to connect to {entry.data[CONF_HOST]}" | ||
| ) from err |
There was a problem hiding this comment.
The coordinator can already handle this on first request/refresh,thispart is thus not needed
There was a problem hiding this comment.
system_get_info is only called in setup - not via a coordinator
I will address this when I add "system" sensors.
|
|
||
| async def _async_update_data(self) -> DslInfo: | ||
| """Update data.""" | ||
| return await self._box.dsl_get_info() |
There was a problem hiding this comment.
This can throw an SFRBoxError, which is unhandled?
Proposed change
Add SFR Box (broadband router) integration
Minimal integration with:
Link to the library: https://github.com/hacf-fr/sfrbox-api
Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.To help with the load of incoming pull requests: