Address silver tier quality scale items - #548
Closed
brianegge wants to merge 14 commits into
Closed
Conversation
Copy Dahua brand icons and logos from the home-assistant/brands repository into custom_components/dahua/brand/ so HACS validation no longer needs to fall back to the brands repository. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add brand assets for HACS validation
… reauth (#22) - Fix session leak in config_flow._test_credentials() by adding finally clause - Fix session leak on unload by calling coordinator.async_stop() which closes session - Fix != None to is not None in _close_session() - Replace DahuaEventThread/DahuaVtoEventThread with native async tasks - Replace threading.Timer in VTO client with loop.call_later() - Replace loop.stop() in VTO with disconnected future for clean reconnect - Fix swallowed exceptions in client.stream_events() (re-raise CancelledError) - Add reauthentication flow triggered on HTTP 401 during initialization - Delete thread.py (no longer needed) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Add Dahua HDW2431TP-AS, T5442TM-AS, B5442E-Z4E, B54IR-ASE and Amcrest IP5M-T1179E, IPC-Color4K-T to the supported cameras list. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* Use go2rtc native streaming instead of ffmpeg Set frontend_stream_type to WEB_RTC so Home Assistant uses go2rtc for camera streams instead of transcoding via ffmpeg. This reduces CPU usage and latency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix session leaks, replace blocking threads with async tasks, and add reauth - Fix session leak in config_flow._test_credentials() by adding finally clause - Fix session leak on unload by calling coordinator.async_stop() which closes session - Fix != None to is not None in _close_session() - Replace DahuaEventThread/DahuaVtoEventThread with native async tasks - Replace threading.Timer in VTO client with loop.call_later() - Replace loop.stop() in VTO with disconnected future for clean reconnect - Fix swallowed exceptions in client.stream_events() (re-raise CancelledError) - Add reauthentication flow triggered on HTTP 401 during initialization - Delete thread.py (no longer needed) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Improve integration quality toward HA bronze tier - Add has_entity_name = True to base entity; entity names now return suffix only (HA auto-prefixes the device name) - Migrate from hass.data[DOMAIN] to ConfigEntry.runtime_data with DahuaConfigEntry type alias - Add removal instructions to README - Add config flow tests covering success, invalid credentials, duplicate device, and options flow Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Apply black formatting to all changed files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix config flow tests: load integration before running Use async_get_integration fixture so HA discovers the custom component config flow handler before tests attempt to init flows. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix test discovery: import config_flow to register handler Replace async_get_integration fixture with a direct import of the config_flow module, which registers the flow handler at import time. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix test discovery by enabling custom integrations in conftest Add auto_enable_custom_integrations fixture so HA's loader can find the dahua integration under custom_components/ during test runs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…s, docs Add dahua_command decorator to wrap all entity action methods with proper HomeAssistantError handling for device communication failures. Set PARALLEL_UPDATES on all platform files. Fix ValueError when selecting "Manual" preset position. Document channel parameter and configuration options in README. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dahua_commanddecorator inentity.pythat wraps all action methods with properHomeAssistantErrorhandling foraiohttp.ClientError,socket.gaierror,asyncio.TimeoutError, and unexpected exceptions@dahua_commandto all ~44 action methods acrosscamera.py,light.py,switch.py, andselect.pyPARALLEL_UPDATESon all platform files (1for command-sending platforms,0for read-onlybinary_sensor)ValueErrorinDahuaCameraPresetPositionSelectwhen "Manual" is selected (was callingint("Manual"))Test plan
pytest tests/— 5/5 passed)🤖 Generated with Claude Code