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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make const Final
  • Loading branch information
dotvav committed Nov 25, 2024
commit 2604c0999106d96028e737ef43ee85d3fe59bea7
2 changes: 1 addition & 1 deletion homeassistant/components/palazzetti/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
FAN_AUTO: Final = "auto"
FAN_MODES: Final = [FAN_SILENT, "1", "2", "3", "4", "5", FAN_HIGH, FAN_AUTO]

STATUSES: dict[str | int | float | None, str] = {
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.

0: "off",
1: "off_timer",
2: "test_fire",
Expand Down