Skip to content

Sub Entries#114

Merged
JackJPowell merged 22 commits into
mainfrom
subEntries
Aug 8, 2025
Merged

Sub Entries#114
JackJPowell merged 22 commits into
mainfrom
subEntries

Conversation

@JackJPowell

Copy link
Copy Markdown
Owner

Adds support for Dock Sub Entries and the subentry flow
General code cleanup

Copilot AI review requested due to automatic review settings August 8, 2025 21:24
@JackJPowell JackJPowell merged commit e0768ea into main Aug 8, 2025
3 of 4 checks passed
@JackJPowell JackJPowell deleted the subEntries branch August 8, 2025 21:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for Dock Sub Entries and implements a configuration subentry flow for managing dock configurations. The changes modernize the dock management system by using Home Assistant's subentry functionality instead of storing dock data directly in the main config entry.

  • Refactors dock configuration to use Home Assistant's subentry system for better organization
  • Implements a new DockSubentryFlowHandler for managing dock addition and configuration
  • Performs data migration from the old dock storage format to the new subentry system

Reviewed Changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
hacs.json Updates minimum Home Assistant version requirement to 2025.7
custom_components/unfoldedcircle/config_flow.py Adds DockSubentryFlowHandler class and removes old dock flow logic
custom_components/unfoldedcircle/init.py Implements migration logic from old dock format to subentries
custom_components/unfoldedcircle/translations/en.json Moves dock translations to config_subentries section
custom_components/unfoldedcircle/coordinator.py Adds UnfoldedCircleRuntimeData dataclass and updates coordinators
custom_components/unfoldedcircle/entity.py Updates dock entity initialization to accept subentry parameters
Multiple platform files Updates dock entity creation to use subentry parameters
pyUnfoldedCircleRemote/* Various cleanup and simplification changes
manifest.json Updates version and pyUnfoldedCircleRemote dependency


def get_dock_name(dock_coordinator: UnfoldedCircleDockCoordinator):
return dock_coordinator.api.name
return dock_coordinator[1].api.name

Copilot AI Aug 8, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line appears to have incorrect tuple indexing. The function expects a UnfoldedCircleDockCoordinator but is trying to access index [1] on it. Based on the context, this should likely be dock_coordinator.api.name since dock_coordinator is already the coordinator object, not a tuple.

Suggested change
return dock_coordinator[1].api.name
return dock_coordinator.api.name

Copilot uses AI. Check for mistakes.
if is_valid or dock_data["password"] != "0000":
create_subentry(hass, entry, dock_data)

hass.add_job(async_remove_device(hass, dock))

Copilot AI Aug 8, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is calling async_remove_device as a coroutine function but wrapping it in hass.add_job(). Since async_remove_device is an async function, it should be awaited or scheduled properly. The correct approach would be hass.async_create_task(async_remove_device(hass, dock)) or await it directly.

Suggested change
hass.add_job(async_remove_device(hass, dock))
hass.async_create_task(async_remove_device(hass, dock))

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants