Skip to content

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

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

astrandb
Copy link
Contributor

@astrandb astrandb commented May 7, 2025

Proposed change

Add sensors that reflect the state of hob heating zones on Miele hobs.

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:

Comment on lines 45 to 84
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,
}
Copy link
Member

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

Copy link
Contributor Author

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}"
Copy link
Member

Choose a reason for hiding this comment

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

why the prefix?

Copy link
Contributor Author

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.

@home-assistant home-assistant bot marked this pull request as draft May 8, 2025 15:40
@home-assistant
Copy link

home-assistant bot commented May 8, 2025

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

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

Successfully merging this pull request may close these issues.

2 participants