jheling / freeathome

Free@Home component for Home Assistant
103 stars 37 forks source link

Use entity services instead of switches for additional functionality #76

Closed Tho85 closed 3 years ago

Tho85 commented 3 years ago

In #70 I added two switches for each cover, forcing the position to be either open, closed or none. In #73, I discovered that this was actually just a single additional functionality for covers, and there are many more for each device. If we'd add a switch for each of these functions, then we would clutter our Home Assistant installation with lots of unwanted switches.

In this PR, I replaced the "force position" switch with an entity service to control the cover's forced position. Current forced position is reported through the cover's attributes.

Example:

Set a cover to forced position "closed": image

Result: image

This gives users the same amount of control, without adding unnecessary switches.