Skip to content
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

Add palazzetti status sensor #131348

Merged
merged 8 commits into from
Dec 17, 2024
Merged

Conversation

dotvav
Copy link
Contributor

@dotvav dotvav commented Nov 23, 2024

Proposed change

Add an enum status sensor to the palazzetti integration.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@@ -17,3 +17,53 @@
FAN_HIGH: Final = "high"
FAN_AUTO: Final = "auto"
FAN_MODES: Final = [FAN_SILENT, "1", "2", "3", "4", "5", FAN_HIGH, FAN_AUTO]

STATUSES: Final[dict[str | int | float | None, str]] = {
Copy link
Member

@zweckj zweckj Nov 25, 2024

Choose a reason for hiding this comment

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

Suggested change
STATUSES: Final[dict[str | int | float | None, str]] = {
STATUS_TO_HA: Final[dict[int, str]] = {

just preference to understand that this is a label mapping

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Out of curiosity, do you think there is value to making this mapping in the library instead of in the integration?

Copy link
Member

Choose a reason for hiding this comment

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

personally I'd probably just make it an IntEnum in the libary, so I don't have to think/remember what each of that codes is.

@dotvav dotvav marked this pull request as draft November 25, 2024 09:55
@dotvav
Copy link
Contributor Author

dotvav commented Nov 25, 2024

Flipping to draft while I figure out why the snapshot test is failing (works on my computer).

@dotvav dotvav force-pushed the palazzetti_status_sensor branch from 704ad22 to b00898b Compare November 25, 2024 10:06
@dotvav dotvav marked this pull request as ready for review November 25, 2024 12:51
@dotvav
Copy link
Contributor Author

dotvav commented Nov 26, 2024

Flipping to draft while I figure out why the snapshot test is failing (works on my computer).

Translations updated, snapshot updated, all checks now passing.

Copy link
Member

@zweckj zweckj left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@zweckj zweckj merged commit c0264f7 into home-assistant:dev Dec 17, 2024
34 checks passed
@dotvav dotvav deleted the palazzetti_status_sensor branch December 17, 2024 10:38
@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants