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

Remove existing accessory from cache #73

Open
mkz212 opened this issue Jun 13, 2024 · 4 comments
Open

Remove existing accessory from cache #73

mkz212 opened this issue Jun 13, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@mkz212
Copy link

mkz212 commented Jun 13, 2024

Great template. But there is no function that removes existing accessories from the cache when they are no longer in the setup. Currently, there are only two options: get from cache or add new ones.

@mkz212 mkz212 added the enhancement New feature or request label Jun 13, 2024
@mkz212
Copy link
Author

mkz212 commented Jul 27, 2024

@uswong
Copy link

uswong commented Aug 17, 2024

Hey @mkz212,

Will this work for you?
https://github.com/uswong/homebridge-plugin-template/blob/latest/src/platform.ts

The lines I have added to remove those existing accessories not restored from cache are as follow:
uswong@8358c8c

@mkz212
Copy link
Author

mkz212 commented Aug 17, 2024

Hey @mkz212,

Will this work for you? https://github.com/uswong/homebridge-plugin-template/blob/latest/src/platform.ts

The lines I have added to remove those existing accessories not restored from cache are as follow: uswong@8358c8c

For me it seems to be ok, but @bwp91 should take a look, he maintain this and knows it best.

@bwp91
Copy link
Contributor

bwp91 commented Oct 25, 2024

i just updated the template with some example code of doing this

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

3 participants