Skip to content

[pull] dev from home-assistant:dev #658

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

Merged
merged 15 commits into from
May 4, 2025
Merged

[pull] dev from home-assistant:dev #658

merged 15 commits into from
May 4, 2025

Conversation

pull[bot]
Copy link

@pull pull bot commented May 4, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

astrandb and others added 15 commits May 4, 2025 11:30
* Use device class transation

* Bump pymiele to 0.4.3

---------

Co-authored-by: Shay Levy <levyshay1@gmail.com>
…144191)

Also fix one missing sentence-casing in corresponding "title" string.
Co-authored-by: Shay Levy <levyshay1@gmail.com>
* Add extreme level to pollen map

* Sort

* Sort
* Give entry unique id with MAC, strings.json tweaks

* Update codeowners

* Add config_flow tests

* Update requirements

* Update homeassistant/components/zimi/__init__.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/zimi/config_flow.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/zimi/config_flow.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Store controller reference in entry.runtime_data instead of hass.data

* Add typing

* Removed hass data pop on unload.  (No longer needed when hass data moved for runtime_data)

* Refactor config_flow based on feedback from @zweckj with inline validation, simpler defaults, better description data

* Add Michael to codeowners

* Remove manual debug override in entity

* Populate via_device

* remove empty keys from manifest.json

* Refactor with DataUpdateCoordinator
Device Entities use existing push update method

* set via_device to match zcc identifier

* Changed logger to use debug level

* Define the zimi constants

* Move extraaneous code out from try

* Move __del__ to async_wil_remove_from_hass

* Use zcc device for name

* Print debug if mac mismatch
Add final exception if api is not ready after connect

* Re-work configuration flow:
1. Remove unused CONF_TIMEOUT, CONF_VERBOSITY and CONF_WATCHDOG
2. Move connect() logic out of ZimiCoordinator
3. Add fast connect check during ConfigFlow to check mac matches
4. Use zcc version 3.2.3 with default watchdog time value (and remove this from HA)

* Add error detail to mac mismatch

* Update homeassistant/components/zimi/config_flow.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/zimi/const.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/zimi/coordinator.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/zimi/coordinator.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/zimi/light.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Remove coordinator and move setup to __init__

* Set name in _attr_name

* Use _light directly for status etc; Remove _state and _brightness; SImplify update()

* Update homeassistant/components/zimi/config_flow.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/zimi/strings.json

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/zimi/config_flow.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/zimi/config_flow.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* No need to delete device, fix return

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Remove non-failing items from try
Abort duplicate configurations

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Move attr change to notify

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/zimi/__init__.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Remove superflous defalt

* Update homeassistant/components/zimi/light.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/zimi/light.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/zimi/config_flow.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/zimi/config_flow.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Move aysnc_connect_to_controller to helpers.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Invert if api

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Update homeassistant/components/zimi/config_flow.py

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Added ZimiConfigEntry to type runtime_data correctly.
Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Use _abort_if_unique_id_configured
Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Invert error logic for cleaner flow
Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Add ZimiDimmer class

* Set colour_mode only in ZimiDimmer

* Use device name instead of entity name
Update deviceinfo for zcc
Update deviceinfo for lights
More ZimiDimmer and ZimiLight cleanup

* Update homeassistant/components/zimi/__init__.py

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Update homeassistant/components/zimi/__init__.py

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Add missing import for CONNECTION_NETWORK_MAC

* @mhannon11 Fixed some minor style changes BUT these tests need re-working now that the config_flow has a second call to the zcc helper to check the API.   The tests as written now fail with connect_fail

* Remove some code from try

* Moved static items from initialiser

* Remove superflous assert when unloading entry

* refactor - move title out of data

* One call to async_add_entities
Update ZimiDimmer to initialise color_modes after calling super()

* Create ZimiEntity base class
(as ToggleEntity)

* Updated test of config_flow

* Move api_mock parameters to test cases

* Much improved tests

* Test for input value mismatch and then recovery of flow

* Import FlowResultType

* Implement Entities event setup correctly

* Initial quality_scale.yml

* Update homeassistant/components/zimi/quality_scale.yml

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Update homeassistant/components/zimi/manifest.json

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Add link to zcc repo

* Update homeassistant/components/zimi/entity.py

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Update homeassistant/components/zimi/entity.py

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Removed unecessary f-strings

* Filled in all of the quality scale

* Updated in line with latest documentation improvements

* FIx missing import for Entity

* Update homeassistant/components/zimi/strings.json

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Update homeassistant/components/zimi/strings.json

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Simplify logger and throw

* Update homeassistant/components/zimi/helpers.py

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Re-factor config_flow with multi-stage steps

* Add comments to notify

* Don't set hw_version

* Update homeassistant/components/zimi/light.py

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Update homeassistant/components/zimi/light.py

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Update homeassistant/components/zimi/quality_scale.yml

Co-authored-by: Josef Zweck <josef@zweck.dev>

* mark docs-troubleshooting done

* Update with zcc-helper version supporting PEP 625 sdist rules on PyPi

* Comment re characteristic ID

* Pulls in latest zcc that closes UDP listening port correctly after discovery timeout

* Re-factored config_flow

1. Try discovery and auto-populate
2. Try manual configuration (with optional values for port and mac)

In most cases, auto-discovery does it all.

Discovery will only fail if UDP broadcast is not possible to/from zcc.

* Do not show error message if discovery fails

* Refactor with self.data and async_show_step_finish()

* Update homeassistant/components/zimi/light.py

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Update homeassistant/components/zimi/config_flow.py

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Update homeassistant/components/zimi/config_flow.py

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Update homeassistant/components/zimi/quality_scale.yml

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Update homeassistant/components/zimi/quality_scale.yml

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Update homeassistant/components/zimi/entity.py

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Update homeassistant/components/zimi/light.py

Co-authored-by: Josef Zweck <josef@zweck.dev>

* refactor import to use ConfigFlow

* Change status for discovery

* Add dynamic title to config flow

* string

* Revert title from form but add IP:port to static title

* Automatically finish configuration if possible, if not show form

* Use StrEnum instead of Exception class

* Remove MAC from user forms

* Disconnect api before form completion

* Assign to self.mac instead of returning as detail

* Updated test suite

* Update test status

* mark action exemptions todo

* Remove mac related error cases from flow completely

* Remove unused MAC error strings

* Moved error details to logs
Removed _error_tuple
Removed error details

* Update homeassistant/components/zimi/config_flow.py

Co-authored-by: Josef Zweck <josef@zweck.dev>

* rename check_errors

* Update homeassistant/components/zimi/config_flow.py

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Update homeassistant/components/zimi/config_flow.py

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Update zcc-helper and support HA devices via zcc manufacter_info fields

* Partial implementation - Use updated zcc-helper to discover multiple controllers

* Config_flow with support for auto-discovery of one or more zcc or fallback to manual configuration.

* Don't re-connect to api if validate_connection already did

* Make fast=False is used for creation

* Pull in improved zcc_helper version to address data completeness after machine_info implementation

* Update homeassistant/components/zimi/config_flow.py

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Import and use ConfigFlowResult

* Latest zcc to fix discovers() return value bug

* Update config_flow.py

* Update homeassistant/components/zimi/manifest.json

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Use latest release version of 3.3 (no changes to rc4)

* Improved sentence casing

* Update strings.json

* Update homeassistant/components/zimi/entity.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Remove superflous logging
Use Zimi network_name as ZCC name
Cleanup device info inputs

* Remove __del__

* Rename arguments

* Update homeassistant/components/zimi/config_flow.py

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

* Move PLATFORMS to init

* Update homeassistant/components/zimi/light.py

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

* Remove debug at init

* Update homeassistant/components/zimi/helpers.py

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

* Remove _attr_has_entity = False

* More naming changes

* Revised config_flow to use zcc-helper for validation using new zcc-helper version

* Update homeassistant/components/zimi/__init__.py

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

* Update homeassistant/components/zimi/__init__.py

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

* Removed commented enum

* s/_entity/_device/g

* Update homeassistant/components/zimi/entity.py

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

* Update homeassistant/components/zimi/helpers.py

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

* Don't log error when raising exception

* Updated tests for new config_flow

* Refactor with new zcc that uses Exception classes to pass errors

* Updated tests for config_flow to use Exceptions

* Device name is based on model

* Device name is None

Maps better to ZCC concept where devices do not have a name but the individual entities have names.

* Fix quality filename

* Bump zcc-helper to 3.4 release version

* Remove name override

* Bump zcc-helper to 3.4.1 with new device_name attribute used to populate devinfo

* Update homeassistant/components/zimi/light.py

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

* Add missing transalation picked up by CI

* Update homeassistant/components/zimi/light.py

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

* Bump zcc-helper to only classify light and dimmer controlPointType as lights

* Bump to non dev version of zcc-helper

* Ruff fixes

* Add missing data description for pytest

* Remove confusing comment

* Update homeassistant/components/zimi/config_flow.py

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

* Update homeassistant/components/zimi/config_flow.py

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

* Update homeassistant/components/zimi/config_flow.py

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

* Update homeassistant/components/zimi/config_flow.py

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

* Update homeassistant/components/zimi/config_flow.py

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

* Update homeassistant/components/zimi/config_flow.py

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

* Update homeassistant/components/zimi/config_flow.py

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

* Update homeassistant/components/zimi/config_flow.py

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

* Update homeassistant/components/zimi/strings.json

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

* Update homeassistant/components/zimi/strings.json

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

* Update homeassistant/components/zimi/strings.json

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

* Update homeassistant/components/zimi/strings.json

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

* Update homeassistant/components/zimi/strings.json

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

* Update homeassistant/components/zimi/config_flow.py

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

* Update homeassistant/components/zimi/config_flow.py

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

* Update homeassistant/components/zimi/const.py

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

* Update homeassistant/components/zimi/config_flow.py

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

* Update homeassistant/components/zimi/config_flow.py

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

* Update homeassistant/components/zimi/const.py

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

* Update homeassistant/components/zimi/const.py

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

* Update homeassistant/components/zimi/strings.json

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

* Update homeassistant/components/zimi/strings.json

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

* Update tests/components/zimi/test_config_flow.py

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

* Update homeassistant/components/zimi/light.py

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

* f-strings

* Update tests/components/zimi/test_config_flow.py

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

* Update tests/components/zimi/test_config_flow.py

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

* Assert result type, step and errors between each step

* test for duplicate entry

* Update tests/components/zimi/test_config_flow.py

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

* Update tests/components/zimi/test_config_flow.py

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

* Update tests/components/zimi/test_config_flow.py

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

* Update tests/components/zimi/test_config_flow.py

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

* Update tests/components/zimi/test_config_flow.py

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

* Remove duplicate test for discovery failure

* Calculate brightness

* Don't re-raise Exception in helper

* Fix ruff and mypi errors

* Add tests for missing connection exceptions

* Added standard invalid_host and timeout strings

* Explain limitations in discovery.

* Update quality_scale.yaml

* Update quality_scale.yaml

* Removed duplicate strings with reference

---------

Co-authored-by: markhannon <mark.hannon@gmail.com>
Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>
Co-authored-by: Josef Zweck <josef@zweck.dev>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
@pull pull bot added the ⤵️ pull label May 4, 2025
@pull pull bot merged commit 2c368c7 into code:dev May 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants