-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
HA-switch support for climate and input_boolean entities #25906
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: master
Are you sure you want to change the base?
HA-switch support for climate and input_boolean entities #25906
Conversation
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.
Hey there - I've reviewed your changes - here's some feedback:
- The
chargerparameter is still a single string, but the updated example now lists three entity IDs separated by commas; this is likely to confuse users and should be adjusted either to show just one valid example or to clarify that only a single entity ID is accepted. - In
GetBoolState, you mapheat,cool, andheat_cooltotrue, but other valid climate states likeauto,fan_only,dry, oraux_heatare not handled explicitly; consider whether any of these should also be treated astruefor climate entities and document or encode that mapping consistently.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `charger` parameter is still a single string, but the updated example now lists three entity IDs separated by commas; this is likely to confuse users and should be adjusted either to show just one valid example or to clarify that only a single entity ID is accepted.
- In `GetBoolState`, you map `heat`, `cool`, and `heat_cool` to `true`, but other valid climate states like `auto`, `fan_only`, `dry`, or `aux_heat` are not handled explicitly; consider whether any of these should also be treated as `true` for climate entities and document or encode that mapping consistently.
## Individual Comments
### Comment 1
<location> `templates/definition/charger/homeassistant-switch.yaml:33` </location>
<code_context>
- name: switch
</code_context>
<issue_to_address>
**suggestion:** The `switch` param wording and example may be misleading now that non-switch domains are allowed.
The parameter is still called `switch` and described as "Entity ID of the switch device", but the service and example now cover `climate` and `input_boolean`, which can be confusing.
Consider either broadening the description (e.g. "Entity ID of the controllable device") or adjusting the example/docs to clearly state that multiple domains are supported while the parameter value remains a single entity ID.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
0f1239d to
a616f76
Compare
climate and input_boolean entities are now supported in addition to switch entities for the homeassistant-switch charger template. This allows controlling devices like heaters, thermostats and smart plugs as chargers.
a616f76 to
2e5207a
Compare
|
I'm not happy with polluting the switch with |

Based on #23509.
climate and input_boolean entities are now supported in addition to switch entities for the homeassistant-switch charger template. This allows controlling devices like heaters, thermostats and smart plugs as chargers.