Skip to content

Allow polling period to be set at instantiation.#6

Merged
richo merged 5 commits into
richo:mainfrom
srcLurker:add_polling_init
Jul 8, 2025
Merged

Allow polling period to be set at instantiation.#6
richo merged 5 commits into
richo:mainfrom
srcLurker:add_polling_init

Conversation

@srcLurker

Copy link
Copy Markdown
Contributor

The home assistant franklin component calls this library and it would be good if the home assistant component could set the polling time. This PR is the first step towards enabling home assistant to set the polling time.

Allows the polling period of the caching thread to be set when the thread is instantiated.

The default polling interval is set to be backwards compatible.

Allow for stopping the thread in a safe manner which makes testing easier.

Add a unit test for the caching_thread.

Allows the polling period of the caching thread to be set
when the thread is instantiated.

Allow for stopping the thread in a safe manner.

Add a unit test caching_thread.
Comment thread franklinwh/caching_thread.py Outdated
@richo

richo commented Jul 4, 2025

Copy link
Copy Markdown
Owner

Hell yeah, thankyou (And thankyou for adding tests).

The empty_stats thing I think I abandoned, I want to say in the end the homeassistant module treats None as a sentinal value for data not being ready yet, but I need to double check that.

@srcLurker

Copy link
Copy Markdown
Contributor Author

Let me know if there is a desire to change the empty_stats back to None.

@richo

richo commented Jul 8, 2025

Copy link
Copy Markdown
Owner

Yeah if you can set it back to None that would be great if not I can do it today.

@srcLurker

Copy link
Copy Markdown
Contributor Author

Changed back to initializing to None. Tests updated as well.

@richo
richo merged commit fab8e68 into richo:main Jul 8, 2025
@richo

richo commented Jul 8, 2025

Copy link
Copy Markdown
Owner

Thanks! Testing locally and then I'll cut new releases

@richo

richo commented Jul 9, 2025

Copy link
Copy Markdown
Owner

I just cut 0.4.0 with this in it

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.

3 participants