-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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 light platform to Linear garage door #111426
Conversation
ed06c04
to
fa96b4d
Compare
fa96b4d
to
80a8690
Compare
3aebdb3
to
1351464
Compare
patch( | ||
"homeassistant.components.linear_garage_door.light.Linear.login", | ||
return_value=True, | ||
), | ||
patch( | ||
"homeassistant.components.linear_garage_door.light.Linear.get_devices", | ||
return_value=[ | ||
{ | ||
"id": "test1", | ||
"name": "Test Garage 1", | ||
"subdevices": ["GDO", "Light"], | ||
}, | ||
{ | ||
"id": "test2", | ||
"name": "Test Garage 2", | ||
"subdevices": ["GDO", "Light"], | ||
}, | ||
], | ||
), | ||
patch( | ||
"homeassistant.components.linear_garage_door.light.Linear.get_device_state", | ||
side_effect=lambda id: { | ||
"test1": { | ||
"GDO": {"Open_B": "true", "Open_P": "100"}, | ||
"Light": {"On_B": "true", "On_P": "100"}, | ||
}, | ||
"test2": { | ||
"GDO": {"Open_B": "false", "Open_P": "0"}, | ||
"Light": {"On_B": "true", "On_P": "100"}, | ||
}, | ||
"test3": { | ||
"GDO": {"Open_B": "false", "Opening_P": "0"}, | ||
"Light": {"On_B": "false", "On_P": "0"}, | ||
}, | ||
"test4": { | ||
"GDO": {"Open_B": "true", "Opening_P": "100"}, | ||
"Light": {"On_B": "true", "On_P": "100"}, | ||
}, | ||
}[id], | ||
), | ||
patch( | ||
"homeassistant.components.linear_garage_door.light.Linear.close", | ||
return_value=True, | ||
), |
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.
Consider creating a broader patch, checkout analytics_insights or Epion
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.
Take a look at what I did with the patches, is that enough?
Edit: Just realized this makes the tests fail, reverting
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
f206e68
to
14dabbd
Compare
I do like the base entity, so if you can maybe open a separate PR to do that before we merge this PR, that'd be nice :) |
Done #116133 |
7e65e94
to
4aacf4c
Compare
db0e87e
to
9efeb12
Compare
6e4dd9d
to
9d6530d
Compare
* Add light platform * Fix light test * Suggestions by CFenner * Fix tests * More fixes * Revert test changes * Undo base entity * Rebase * Fix to use base entity * Fix name * More fixes * Fix tests * Add translation key --------- Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Proposed change
Adds the light platform to Linear.
These are not separate lights, but only lights that are inside of garage door openers.
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
..coveragerc
.To help with the load of incoming pull requests: