Skip to content
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

Output Control Support #29

Merged
merged 12 commits into from
Sep 28, 2023
Merged

Output Control Support #29

merged 12 commits into from
Sep 28, 2023

Conversation

Ay1tsMe
Copy link
Contributor

@Ay1tsMe Ay1tsMe commented Sep 11, 2023

I've completed the output control changes so that it is now supported in the ha-ultrasync integration.

Changes made:

  • Created a ultrasync switch service that executes the set_output_control function
  • Created output sensors for each output

Before you merge it, I just need double checking that integration works for users who do not have an output control in there alarm.

Also, the states of the output correctly initialise to 0 as they should when the integration is loaded but when the output is switched on, the sensor doesn't change state from 0 to 1. I think my code for the coordinator.py is not 100% correct. If you could take a look that would be great.

I haven't found any use case where the state of the output would need to be tracked as the main functionality of opening and closing the output through the switch is what i wanted to get working in home assistant. But having the output sensor state update as it should would be nice.

@caronc
Copy link
Owner

caronc commented Sep 23, 2023

Sorry to take so long to merge this; just looking at it now.

For those who don't have outputs (like me for example, i have a very old UltraSync panel); merging this code shouldn't break? Is the output defined but blanked for all (so this code runs gracefully)? Then of course for people like you, you get to leverage the added capability?

@Ay1tsMe
Copy link
Contributor Author

Ay1tsMe commented Sep 23, 2023

I think I've written it in a way where it shouldn't conflict with users who don't have an output on their ultrasync panel. But I'm not 100 percent sure of this. If you are using HACS or have a way to install my repo in your HASS and just check in the logs so that it's not doing any weird behaviour that would be reassuring.

My branch works for me and I've been using it flawlessly over the past few weeks. I just don't want other users to have issues.

@caronc caronc merged commit 3428d1c into caronc:main Sep 28, 2023
@caronc
Copy link
Owner

caronc commented Sep 28, 2023

I reviewed it; i don't see the harm in the PR. Merging it now and closing. Thanks for this!

@caronc
Copy link
Owner

caronc commented Sep 28, 2023

On a side note; it might be cool if you could do another PR on the side and update the README.md file (similar to how the Sensors are defined). Perhaps share how the output_* switches can be accessed and toggled (an example or something)?

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

Successfully merging this pull request may close these issues.

2 participants