Add missing constants trigger_typeand condition_type#93415
Conversation
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
emontnemery
left a comment
There was a problem hiding this comment.
Thanks @Ludy87 👍
We should maybe generate the lists instead of hardcoding them though?
| @@ -72,6 +72,7 @@ | |||
|
|
|||
| TURNED_ON = [ | |||
There was a problem hiding this comment.
Could we maybe generate these instead to avoid this happening again?
TURNED_ON = [trigger[0] for trigger in ENTITY_TRIGGERS.values()]
TURNED_OFF= [trigger[1] for trigger in ENTITY_TRIGGERS.values()]There was a problem hiding this comment.
It would be a good idea, I'm not that proficient in python yet.
There was a problem hiding this comment.
Should I update the PR?
There was a problem hiding this comment.
Yes, please 👍
You can run the binary_sensor tests to verify it's working:
pytest -vvx tests/components/binary_sensor/
There was a problem hiding this comment.
This would work after running the audit
TURNED_ON = [trigger[0]["type"] for trigger in ENTITY_TRIGGERS.values()]
TURNED_OFF = [trigger[1]["type"] for trigger in ENTITY_TRIGGERS.values()]
|
Removed from milestone, please re-add when the requested change has been made. I've marked this PR, as changes are requested that need to be processed. Thanks! 👍 ../Frenck |
emontnemery
left a comment
There was a problem hiding this comment.
Thanks a lot @Ludy87 👍
Proposed change
Type of change
Additional information
Checklist
black --fast 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..coveragerc.To help with the load of incoming pull requests: