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

Home Assistant integration with light example #49

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

newtonheath
Copy link

@newtonheath newtonheath commented Jan 22, 2025

Some hackery to allow a Presto to integrate with Home Assistant.

config.py
configuration with host, token, and entity configuration

hampws.py
class to provide access to Home Assistant

hampws_light.py
demonstration of a button that reads state of a light from Home assistant - shows the state on screen as a button either yellow for on or black for off - will continue to read state and update if the light state changes outside of the Presto - will also allow the user to touch the button to turn the light off and on - huzzah!

hampws_test.py
some test code for some of the methods in the class - could do with some improvement for sure - there are some heavy logging outputs here, but for sure will help the user to learn some of the back and forth

HAMPWS (Home Assistant Micro Python Web Socket) Class, test code, and a demo of a button that can turn a light off and on as well as change state if light changes remotely
@Gadgetoid
Copy link
Member

Thank you.

Could I trouble you to move these into examples/home_assistant please? The HA specific config feels weird in the root.

@newtonheath
Copy link
Author

Here you go @Gadgetoid

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