-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
Add Lunatone gateway integration #149182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Add Lunatone gateway integration #149182
Conversation
This will be mandatory in the future according to the official documenation (See https://developers.home-assistant.io/docs/creating_integration_manifest).
The device ID should be as "unique" as the line/address combination.
The URL can now be changed during reconfiguration.
The domain should not be included in the config flow unique ID according to: https://developers.home-assistant.io/docs/config_entries_config_flow_handler/#unique-ids
This reverts commit 7ae8113f1ead6ea120c8abf93500456ad0d6a48b.
Add missing fixtures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also check the errors in hassfest regarding dependency version restrictions
if user_input is not None: | ||
method = user_input[CONF_SCAN_METHOD] | ||
if method == DALIDeviceScanMethod.DO_NOTHING: # Skip device scan | ||
return await self.async_step_finish({}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens with the integration when DO_NOTHING is selected? will it have any entities?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can have entities if the gateway already has a device list. If the device list is empty (e.g., in the case of a new gateway), a device for the gateway will still be created, but it won’t have any associated entities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens with the integration when DO_NOTHING is selected?
No device scan is performed and according to the stored device list entities and devices are created.
DO_NOTHING = "do_nothing" | ||
CURRENT_DEVICE_LIST = "current_device_list" | ||
SYSTEM_EXTENSION = "system_extension" | ||
NEW_INSTALLATION = "new_installation" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the differences between these scan methods? Could it be automatic somehow? Or omitted? What happens if it is always set to new_installation, for example?
We should explain it in the docs too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the differences between these scan methods?
- DO_NOTHING: No device scan is performed and according to the stored device list entities and devices are created.
- CURRENT_DEVICE_LIST: The device list values (like brightness, on/off, failures) is actively updated with fresh values from DALI bus.
- SYSTEM_EXTENSION: A none disruptive device scan is performed that can find new devices and address them but doesn't remove any existing DALI addresses.
- NEW_INSTALLATION: This device scan deletes the stored device list and all DALI addresses. Then it newly addresses the devices on the DALI bus and creates the device list.
What happens if it is always set to new_installation, for example?
That would be the worst choice as a default because it deletes all addresses from DALI devices.
if self.dali_device_scan_task: | ||
next_step_id = None | ||
if self.dali_device_scan_task.cancelled(): | ||
_LOGGER.debug("DALI device scan timeout") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't the task cancelled when the user closes the form too? if so, this log is misleading
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tried this and the debugger didn't hit the breakpoint there when I closed the form. Is there another way to determine if the form is closed?
last_step=False, | ||
) | ||
|
||
async def async_step_failed( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this step needed? can we call async_abort directly where it fails instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I start async_show_progress()
with _dali_device_scan_task
and when it is finished or failed async_show_progress_done()
has to be called. This method needs next_step_id
set to a step ID. So I think this has to stay this way.
I addressed this in commit f109053. I'm wondering is this normal that I didn't get these dependency version restriction errors when I run hassfest locally? |
Co-authored-by: Abílio Costa <abmantis@users.noreply.github.com>
Co-authored-by: Abílio Costa <abmantis@users.noreply.github.com>
The unique_id of the config entry should always be set.
Instead DATA_SCHEMA is used directly.
Co-authored-by: Abílio Costa <abmantis@users.noreply.github.com>
7a07309
to
545f34d
Compare
Co-authored-by: Abílio Costa <abmantis@users.noreply.github.com>
With the version of the config flow set to 0 some tests were failing without the dummy function. With the version set to 1 the dummy function is no longer needed. Co-authored-by: Abílio Costa <abmantis@users.noreply.github.com>
11acaa0
to
a27bdb8
Compare
Co-authored-by: Abílio Costa <abmantis@users.noreply.github.com>
Breaking change
Proposed change
This new integration should make it possible to easily integrate Lunatone devices that support REST API.
Type of change
Additional information
Checklist
ruff format 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
.To help with the load of incoming pull requests: