-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
Add plate sensors for Miele hobs #144400
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
base: dev
Are you sure you want to change the base?
Add plate sensors for Miele hobs #144400
Conversation
PLATE_POWERS = [ | ||
"p_0", | ||
"p_110", | ||
"p_220", | ||
"p_1", | ||
"p_2", | ||
"p_3", | ||
"p_4", | ||
"p_5", | ||
"p_6", | ||
"p_7", | ||
"p_8", | ||
"p_9", | ||
"p_10", | ||
"p_11", | ||
"p_12", | ||
"p_13", | ||
"p_14", | ||
"p_15", | ||
"p_16", | ||
"p_17", | ||
"p_18", | ||
"p_117", | ||
"p_118", | ||
"p_217", | ||
] | ||
|
||
|
||
DEFAULT_PLATE_COUNT = 4 | ||
|
||
PLATE_COUNT = { | ||
"KM7678": 6, | ||
"KM7697": 6, | ||
"KM7878": 6, | ||
"KM7897": 6, | ||
"KMDA7633": 5, | ||
"KMDA7634": 5, | ||
"KMDA7774": 5, | ||
"KMX": 6, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those belong in the lib imo (PLATE_POWERS
as an enum). PLATE_POWERS
, maybe you could argue to keep here, but not PLATE_COUNT
that's no information HA should store
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep tables like PLATE_POWERS here. I had the same discussion regarding the program codes etc in const.py. Everytime you discover a new code you would have to make changes in both the library and strings.json. I think it will make maintenance will be complex if we go that way. But I can agree that device & model specific data like PLATE_COUNT could be "hidden" in the library even if it also means that two projects need new releases everytime a new model deviates from default.
I am a flexible guy so if you say move it, I will move it.
if self.device.state_plate_step | ||
else 0 | ||
) | ||
return f"p_{plate_power}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the prefix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had problems with keys with leading numeric characters in another area so I made this without reflecting too much. It don't have access to a hob so it takes some time to verify that everything works IRL, but I will give it a try without the prefix.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Proposed change
Add sensors that reflect the state of hob heating zones on Miele hobs.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: