Closed scribblrsam closed 2 years ago
I'd like to add a json-schema check but thought that could be another PR if you agree.
I also noticed that the doc string for async_load_page
says it clears the page but as far as i can see it just overwrites. Is this intentional?
I'd like to add a json-schema check but thought that could be another PR if you agree.
OK!
I also noticed that the doc string for
async_load_page
says it clears the page but as far as i can see it just overwrites. Is this intentional?
I think it something that changed meanwhile and was never updated in documentation
One question, if the same filename is present as both json and jsonl, which one has priority?
I think it something that changed meanwhile and was never updated in documentation
I'll edit the docstring, unless you want to put the clear back in?
One question, if the same filename is present as both json and jsonl, which one has priority?
@nagyrobi - I dont think this is an case that exists the component requires a valid path to a file. You would need to specify a file ending in .json for this PR to make a difference. All other extenstions including .jsonl are processed as before
I think it something that changed meanwhile and was never updated in documentation
I'll edit the docstring, unless you want to put the clear back in?
I'm fine with any solution @nagyrobi and @fvanroie what do you think ?
I think it something that changed meanwhile and was never updated in documentation
I'll edit the docstring, unless you want to put the clear back in?
I'm fine with any solution @nagyrobi and @fvanroie what do you think ?
Fine by me.
I'm fine with any solution @nagyrobi and @fvanroie what do you think ?
"""Clear current pages and load new ones."""
jsonl
commands create an object if it doesn't exist and update the object if it already exists.
However, you can not change the obj
type once the object has been created.
To clear everything and recreate all objects, you need to call clearpage all
first.
Personally, I think that a clearpage all
first would be a good idea, this
ensures that any objects which are deleted from the pages file are removed
without the need to reboot.
On Thu, 26 Aug 2021 at 15:26, fvanroie @.***> wrote:
I'm fine with any solution @nagyrobi https://github.com/nagyrobi and @fvanroie https://github.com/fvanroie what do you think ?
"""Clear current pages and load new ones."""
jsonl https://haswitchplate.github.io/openHASP-docs/0.6.1/commands/#jsonl commands create an object if it doesn't exist and update the object if it already exists. However, you can not change the obj type once the object has been created.
To clear everything and recreate all objects, you need to call clearpage all https://haswitchplate.github.io/openHASP-docs/0.6.1/commands/#clearpage first.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/HASwitchPlate/openHASP-custom-component/pull/67#issuecomment-906462066, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB35DFCPAPBRYOFX2UAREGLT6ZFK7ANCNFSM5CZ7ECMQ .
Personally, I think that a
clearpage all
first would be a good idea
There are cases when this is not desired to be done automatically. When you want to clear all, use a command service call and clear the pages separately first, and start parsing jsonls after that.
So have a load_pages
and reload_pages
?
No need. It's fine the way it is now, no need to change anything. If you want to clear pages in advance, use the apropriate clearpage command in HA automation sequence, before loading of the page.
We already have these services: https://haswitchplate.github.io/openHASP-docs/0.6.1/integrations/home-assistant/howto/#services
There are cases when this is not desired to be done automatically
I'll just update the docstring for that function for clarity! Sorry, I didn't mean for that to spiral, it just confused me when reading it.
All good! Thanks! 🎉
openHASP (ArduinoJSON really) optimizes the jsonl stream for fast decoding.
One future optimization is to append a payload buffer with more <object>\n
strings up until 1000 characters and then send it via MQTT. There is a small overhead with incoming mqtt data, so more jsonl
objects in the same payload will be faster than individual messages...
How does this look for a first pass based upon the descussion in the main openHASP project?
Outstanding:
Example pages.json file: