Skip to content

Fix YAML import and handle optional configuration values#461

Open
r0nmlt wants to merge 1 commit into
RobHofmann:masterfrom
r0nmlt:fix-yaml-import
Open

Fix YAML import and handle optional configuration values#461
r0nmlt wants to merge 1 commit into
RobHofmann:masterfrom
r0nmlt:fix-yaml-import

Conversation

@r0nmlt

@r0nmlt r0nmlt commented Jun 9, 2026

Copy link
Copy Markdown

Summary

Fixes YAML-based configuration imports.

The integration currently declares a YAML configuration schema and documents YAML configuration in the README, however async_step_import() forwards directly to async_step_user(), causing imported entries to stop at the manual configuration step instead of creating config entries automatically.

Additionally, test_connection() expects optional fields such as encryption_key and uid to be present, resulting in:

KeyError: 'encryption_key'

when using the documented YAML configuration examples.

Changes

  • Process YAML imports directly in async_step_import()
  • Populate defaults for optional configuration values before connection testing
  • Validate connectivity before creating entries
  • Preserve unique ID handling to prevent duplicate entries
  • Create config entries automatically from YAML definitions

Tested

Tested successfully on Home Assistant 2026.6.1 with multiple Gree units defined through YAML configuration.

The following configuration imports correctly and creates config entries automatically:

gree:
  - name: "Living Room"
    host: "192.168.1.101"
    mac: "20-FA-BB-12-34-56"
    encryption_version: 1

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.

1 participant