Commit graph

20 commits

Author SHA1 Message Date
Erik Montnemery
e06446d0fa
Migrate integrations e-h to generic flowhandler () 2024-02-29 20:07:36 +01:00
J. Nick Koston
6ed221de5d
Handle empty name in powerview config flow ()
fixes

```
2024-02-19 13:51:58.128 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved:   File "/Users/bdraco/home-assistant/venv/bin/hass", line 8, in <module>
    sys.exit(main())
  File "/Users/bdraco/home-assistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/Users/bdraco/home-assistant/homeassistant/runner.py", line 188, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/opt/homebrew/Cellar/python@3.12/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 673, in run_until_complete
    self.run_forever()
  File "/opt/homebrew/Cellar/python@3.12/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 640, in run_forever
    self._run_once()
  File "/opt/homebrew/Cellar/python@3.12/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 1965, in _run_once
    handle._run()
  File "/opt/homebrew/Cellar/python@3.12/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/events.py", line 84, in _run
    self._context.run(self._callback, *self._args)
  File "/Users/bdraco/home-assistant/homeassistant/helpers/entity_platform.py", line 610, in async_add_entities
    await add_func(coros, entities, timeout)
  File "/Users/bdraco/home-assistant/homeassistant/helpers/entity_platform.py", line 561, in _async_add_entities
    await coro
  File "/Users/bdraco/home-assistant/homeassistant/helpers/entity_platform.py", line 652, in _async_add_entity
    entity.add_to_platform_start(
  File "/Users/bdraco/home-assistant/homeassistant/components/device_tracker/config_entry.py", line 356, in add_to_platform_start
    _async_connected_device_registered(
  File "/Users/bdraco/home-assistant/homeassistant/components/device_tracker/config_entry.py", line 94, in _async_connected_device_registered
    async_dispatcher_send(
  File "/Users/bdraco/home-assistant/homeassistant/helpers/dispatcher.py", line 227, in async_dispatcher_send
    hass.async_run_hass_job(job, *args)
  File "/Users/bdraco/home-assistant/homeassistant/core.py", line 701, in async_run_hass_job
    hassjob.target(*args)
  File "/Users/bdraco/home-assistant/homeassistant/util/logging.py", line 133, in _callback_wrapper
    func(*args)
  File "/Users/bdraco/home-assistant/homeassistant/components/dhcp/__init__.py", line 392, in _async_process_device_data
    self.async_process_client(ip_address, hostname, mac_address)
  File "/Users/bdraco/home-assistant/homeassistant/components/dhcp/__init__.py", line 268, in async_process_client
    discovery_flow.async_create_flow(
  File "/Users/bdraco/home-assistant/homeassistant/helpers/discovery_flow.py", line 32, in async_create_flow
    hass.async_create_task(init_coro, f"discovery flow {domain} {context}")
  File "/Users/bdraco/home-assistant/homeassistant/core.py", line 634, in async_create_task
    task = self.loop.create_task(target, name=name)
Traceback (most recent call last):
  File "/Users/bdraco/home-assistant/homeassistant/config_entries.py", line 1017, in async_init
    flow, result = await self._async_init(flow_id, handler, context, data)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bdraco/home-assistant/homeassistant/config_entries.py", line 1047, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bdraco/home-assistant/homeassistant/data_entry_flow.py", line 501, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bdraco/home-assistant/homeassistant/components/hunterdouglas_powerview/config_flow.py", line 127, in async_step_dhcp
    return await self.async_step_discovery_confirm()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bdraco/home-assistant/homeassistant/components/hunterdouglas_powerview/config_flow.py", line 152, in async_step_discovery_confirm
    assert self.discovered_ip and self.discovered_name
AssertionError
```
2024-02-20 10:41:38 +01:00
kingy444
3529eb6044
Powerview Gen 3 functionality ()
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-15 08:27:11 -06:00
Marc Mueller
5ef04fcc7b
Improve hunterdouglas_powerview typing () 2024-01-08 10:08:52 +01:00
Marc Mueller
5dd3f05db8
Use asyncio.timeout [f-h] () 2023-08-15 08:37:06 -05:00
Ville Skyttä
ae302bbec0
Make use of str.removeprefix and .removesuffix () 2023-01-13 12:19:38 +01:00
kingy444
a816348616
Powerview dataclass ()
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-06-21 11:12:11 -05:00
epenet
ffb9b4cd2d
Use dataclass properties in hunterdouglas discovery () 2021-11-30 05:16:30 -10:00
epenet
d6c5aaa0cb
Use ServiceInfo in hunterdouglas_powerview ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-19 08:12:31 -06:00
J. Nick Koston
19aee19efd
Resolve race condition in powerview when discovered by zeroconf and dhcp ()
Set the host in the context before checking to ensure
that the second discovery aborts. Seen when testing
on a very fast system only
2021-05-21 07:40:55 +02:00
J. Nick Koston
34c84a6bbb
Reduce boilerplate to abort for matching config entries ()
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-05-11 22:00:12 +02:00
J. Nick Koston
29cd5f20b9
Add zeroconf discovery to powerview () 2021-05-09 11:41:27 +02:00
J. Nick Koston
779f34a8ed
Add dhcp discovery to hunterdouglas_powerview ()
* Add dhcp discovery to hunterdouglas_powerview

* avoid dupe flow

* cleanup

* cleanup
2021-05-03 11:41:20 +02:00
Franck Nijhof
10d6dfd4ae
Clean up connection classes in integrations H-L () 2021-04-30 21:02:53 -10:00
Ruslan Sayfutdinov
7a9385d857
Explicitly define all methods in ConfigFlow () 2021-04-17 12:42:31 +02:00
Marc Mueller
2956eb0902
Update pylint to 2.7.3 ()
* Update pylint to 2.7.3

* Add class-const-naming-style

* Remove unused-import message

* Additional cleanup
2021-03-29 18:02:56 -10:00
J. Nick Koston
d733292982
Remove YAML support from hunterdouglas_powerview () 2021-01-21 13:51:08 -05:00
Ville Skyttä
b4bac0f7a0
Exception chaining and wrapping improvements ()
* Remove unnecessary exception re-wraps

* Preserve exception chains on re-raise

We slap "from cause" to almost all possible cases here. In some cases it
could conceivably be better to do "from None" if we really want to hide
the cause. However those should be in the minority, and "from cause"
should be an improvement over the corresponding raise without a "from"
in all cases anyway.

The only case where we raise from None here is in plex, where the
exception for an original invalid SSL cert is not the root cause for
failure to validate a newly fetched one.

Follow local convention on exception variable names if there is a
consistent one, otherwise `err` to match with majority of codebase.

* Fix mistaken re-wrap in homematicip_cloud/hap.py

Missed the difference between HmipConnectionError and
HmipcConnectionError.

* Do not hide original error on plex new cert validation error

Original is not the cause for the new one, but showing old in the
traceback is useful nevertheless.
2020-08-28 13:50:32 +02:00
J. Nick Koston
87e0f04515
Fix exception in hunterdouglas_powerview with ignored config entry () 2020-05-10 22:06:31 -07:00
J. Nick Koston
6c18a2cae2
Config flow for hunterdouglas_powerview ()
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-29 14:24:57 -07:00