Skip to content

Conversation

@johnmschoonover
Copy link
Owner

Summary

  • add an async config flow for Sony Projector with user, import, and reauth steps keyed by host
  • provide config flow copy in strings and localized English translation files
  • cover the flow with unit tests for happy path, duplicate prevention, and reauthentication

Testing

  • python -m script.hassfest --integration-path homeassistant/components/sony_projector
  • pytest tests/components/sony_projector/test_config_flow.py

https://chatgpt.com/codex/tasks/task_e_6903eb25bc0c8333a45b6d20d2546712

@johnmschoonover johnmschoonover changed the base branch from sony_projector_switch_upgrade to dev October 31, 2025 03:51
@johnmschoonover johnmschoonover changed the base branch from dev to sony_projector_switch_upgrade October 31, 2025 03:52
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +42 to +65
async def async_step_user(
self, user_input: Mapping[str, Any] | None = None
) -> ConfigFlowResult:
"""Handle a flow initiated by the user."""

errors: dict[str, str] = {}

if user_input is not None:
host = user_input[CONF_HOST]

try:
await _async_validate_input(self.hass, user_input)
except CannotConnect:
errors["base"] = "cannot_connect"
except UnknownError:
errors["base"] = "unknown"
else:
await self.async_set_unique_id(host)
self._abort_if_unique_id_configured(updates={CONF_HOST: host})

return self.async_create_entry(
title=DEFAULT_TITLE,
data={CONF_HOST: host},
)

Choose a reason for hiding this comment

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

P1 Badge Config entries created but integration never sets up entities

The flow now calls async_create_entry and the manifest enables config_flow, but the integration still only exposes the legacy setup_platform in switch.py and has no async_setup_entry to load platforms from a config entry. After users complete the UI flow, Home Assistant will store the entry but never create a switch, leaving the projector unusable. Config entry support (e.g. forwarding to the switch platform) needs to be implemented in the integration before exposing a flow.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants