-
Notifications
You must be signed in to change notification settings - Fork 25
Add Websocket "config entries" methods #213
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
GrandMoff100
merged 29 commits into
GrandMoff100:dev
from
mj23000:add_websocket_config_entries
Mar 21, 2026
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
d72cdcf
Add from_json to BaseModel to reduce duplicated code
mj23000 ae03d15
Fix Websocket Error model by not requiring translation keys
mj23000 3954660
Add method to get non-user flows in progress
mj23000 65e39cc
Add disable/enable config entry methods
mj23000 d79ff4a
Add ignore flow method
mj23000 6443a29
Add method to get a filtered list of config entries
mj23000 90a14ca
Add get entry subentry method
mj23000 6156007
Add delete subentry method
mj23000 9292ae2
Fix typing
mj23000 fce15b6
Add Websocket endpoints to docstrings
mj23000 9836466
Add config_entries subscribe method
mj23000 e5101b3
Add testing
mj23000 c8ec47f
Merge branch 'dev' into add_websocket_config_entries
GrandMoff100 bfced2f
Add from_json to BaseModel to reduce duplicated code
mj23000 6ceac43
Add method to get non-user flows in progress
mj23000 8e4ce7a
Add disable/enable config entry methods
mj23000 2899499
Add ignore flow method
mj23000 245d892
Add method to get a filtered list of config entries
mj23000 0c375a0
Add get entry subentry method
mj23000 d161c74
Add delete subentry method
mj23000 46148a4
Fix typing
mj23000 475991e
Add Websocket endpoints to docstrings
mj23000 723a9d9
Add config_entries subscribe method
mj23000 171509f
Add testing
mj23000 d5a73d4
add missing testing.
adamlogan73 e9d5372
Merge remote-tracking branch 'mj23000/add_websocket_config_entries' i…
adamlogan73 15f62c9
update ruff commands in github cicd pipeline
adamlogan73 3812d36
Update Python build_from version and fix websocket client fixture type
GrandMoff100 84c0ec6
Fix test coverage for logbook and entity history tests
adamlogan73 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,158 @@ | ||
| """File for models used in responses from config entries.""" | ||
|
|
||
| import asyncio | ||
| from enum import Enum | ||
| from typing import Any, Container, Dict, Optional, Tuple, Union | ||
|
|
||
| from .base import BaseModel | ||
|
|
||
|
|
||
| class FlowResultType(Enum): | ||
| """Result type for a data entry flow.""" | ||
|
|
||
| FORM = "form" | ||
| CREATE_ENTRY = "create_entry" | ||
| ABORT = "abort" | ||
| EXTERNAL_STEP = "external" | ||
| EXTERNAL_STEP_DONE = "external_done" | ||
| SHOW_PROGRESS = "progress" | ||
| SHOW_PROGRESS_DONE = "progress_done" | ||
| MENU = "menu" | ||
|
|
||
|
|
||
| class DiscoveryKey(BaseModel): | ||
| """Serializable discovery key.""" | ||
|
|
||
| domain: str | ||
| key: Union[str, Tuple[str, ...]] | ||
| version: int | ||
|
|
||
|
|
||
| class FlowContext(BaseModel): | ||
| """Base flow context""" | ||
|
|
||
| show_advanced_options: Union[bool, None] = None | ||
| source: str | ||
|
|
||
|
|
||
| class ConfigFlowContext(FlowContext): | ||
| """Context for config flow.""" | ||
|
|
||
| alternative_domain: Optional[str] = None | ||
| configuration_url: Optional[str] = None | ||
| confirm_only: Optional[bool] = None | ||
| discovery_key: DiscoveryKey | ||
| entry_id: Optional[str] = None | ||
| title_placeholders: Optional[Dict[str, str]] = None | ||
| unique_id: Optional[str] = None | ||
|
|
||
|
|
||
| class FlowResult(BaseModel): | ||
| """Base flow result .""" | ||
|
|
||
| context: ConfigFlowContext | ||
| data_schema: Optional[Any] = None | ||
| data: Optional[Dict[str, Any]] = None | ||
| description_placeholders: Optional[Dict[str, str]] = None | ||
| description: Optional[str] = None | ||
| errors: Optional[Dict[str, str]] = None | ||
| extra: Optional[str] = None | ||
| flow_id: str | ||
| handler: str | ||
| last_step: Optional[bool] = None | ||
| menu_options: Optional[Container[str]] = None | ||
| preview: Optional[str] = None | ||
| progress_action: Optional[str] = None | ||
| progress_task: Optional[asyncio.Task[Any]] = None | ||
| reason: Optional[str] = None | ||
| required: Optional[bool] = None | ||
| result: Optional[Any] = None | ||
| step_id: Optional[str] = None | ||
| title: Optional[str] = None | ||
| translation_domain: Optional[str] = None | ||
| type: Optional[FlowResultType] = None | ||
| url: Optional[str] = None | ||
|
|
||
|
|
||
| class DisableEnableResult(BaseModel): | ||
| """Result from a disable/enable config entry call.""" | ||
|
|
||
| require_restart: bool | ||
|
|
||
|
|
||
| class IntegrationTypes(Enum): | ||
| """Types of integrations.""" | ||
|
|
||
| ENTITY = "entity" | ||
| DEVICE = "device" | ||
| HARDWARE = "hardware" | ||
| HELPER = "helper" | ||
| HUB = "hub" | ||
| SERVICE = "service" | ||
| SYSTEM = "system" | ||
| VIRTUAL = "virtual" | ||
|
|
||
|
|
||
| class ConfigEntryState(str, Enum): | ||
| """Config entry state.""" | ||
|
|
||
| LOADED = "loaded" | ||
| SETUP_ERROR = "setup_error" | ||
| MIGRATION_ERROR = "migration_error" | ||
| SETUP_RETRY = "setup_retry" | ||
| NOT_LOADED = "not_loaded" | ||
| FAILED_UNLOAD = "failed_unload" | ||
| SETUP_IN_PROGRESS = "setup_in_progress" | ||
| UNLOAD_IN_PROGRESS = "unload_in_progress" | ||
|
|
||
|
|
||
| class ConfigEntryDisabler(Enum): | ||
| """What disabled a config entry.""" | ||
|
|
||
| USER = "user" | ||
|
|
||
|
|
||
| class ConfigEntry(BaseModel): | ||
| """A configuration entry. This is the model that Home Assistant returns, but not what is used internally.""" | ||
|
|
||
| created_at: float | ||
| entry_id: str | ||
| domain: str | ||
| modified_at: float | ||
| title: str | ||
| source: str | ||
| state: ConfigEntryState | ||
| supports_options: bool | ||
| supports_remove_device: bool | ||
| supports_unload: bool | ||
| supports_reconfigure: bool | ||
| supported_subentry_types: Dict[str, Dict[str, bool]] | ||
| pref_disable_new_entities: bool | ||
| pref_disable_polling: bool | ||
| disabled_by: Optional[ConfigEntryDisabler] | ||
| reason: Optional[str] | ||
| error_reason_translation_key: Optional[str] | ||
| error_reason_translation_placeholders: Optional[Dict[str, Any]] | ||
| num_subentries: int | ||
|
|
||
|
|
||
| class ConfigSubEntry(BaseModel): | ||
| """A configuration sub-entry. This is the model that Home Assistant returns, but not what is used internally.""" | ||
|
|
||
| subentry_id: str | ||
| subentry_type: str | ||
| title: str | ||
| unique_id: Optional[str] | ||
|
|
||
|
|
||
| class ConfigEntryChange(str, Enum): | ||
| """What was changed in a config entry.""" | ||
|
|
||
| ADDED = "added" | ||
| REMOVED = "removed" | ||
| UPDATED = "updated" | ||
|
|
||
|
|
||
| class ConfigEntryEvent(BaseModel): | ||
| type: Optional[ConfigEntryChange] | ||
| entry: ConfigEntry |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.