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

Add entities to turn addon on/off #23

Open
chrisdrackett opened this issue May 15, 2024 · 2 comments
Open

Add entities to turn addon on/off #23

chrisdrackett opened this issue May 15, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@chrisdrackett
Copy link
Contributor

Right now I'm running into an issue where if I'm doing development on my computer while the addon is running on HASS they sometimes conflict as they are both running similar but often not the same code. To get around this I currently need to turn the automations running on HASS off while doing development.

I've added a toggle helper that is turned on by the dev server when its running and in production stops all my automations from running. I'm just wondering if others are doing non-local dev if this might be a useful built-in feature.

@chrisdrackett chrisdrackett added the enhancement New feature or request label May 15, 2024
@zoe-codez
Copy link
Member

There is support for this type of operation in the library, but it's not well documented & requires some implementation details by the dev.

https://github.com/Digital-Alchemy-TS/hass/blob/main/src/extensions/websocket-api.extension.ts#L670

hass.socket.pauseMessages = true

Setting this will cause entity update events to not fire, and for the socket to black hole outgoing messages. Internal workflows, such as maintaining accurate state & registry should still work properly, allowing it to pick up without missing a beat.

I haven't run across a standardized approach to automatically controlling that flag that'd work out of the box though. When the upgraded synapse integration is complete, this would probably be a lot more straightforward to accomplish

@chrisdrackett
Copy link
Contributor Author

I think I can still probably use this, basically just toggle this based on my switch vs. building a wrapper like I've done so far :)

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

No branches or pull requests

2 participants