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
Fixes and features for tile structure #1351
Fixes and features for tile structure #1351
Conversation
… example (REST proxy needs POST support for this)
… example (REST proxy needs POST support for this)
also re-generate all files to apply prettier code transformations
(e.g. to copy own code to target)
…se no browser shows that
This is a great idea. What does the backend need to provide to make it work?
What does this fix / what exactly wasn't working before? |
The backend needs to send a value that the cometvisu converts to a date object. And the you have to add an cv-address to a widget like this Important is the transform to a date and the target value "last-update:120" which means if the date is older that 120 seconds the widget is marked as outdated (little red triangle in the upper left corner with an exclamation mark in it). Full example: <cv-info format="%d" style="color: #f2495c">
<cv-address slot="address" transform="OH:number" mode="read">Meter_Energy_Grid_Import</cv-address>
<cv-address slot="tileAddress" transform="OH:datetime" mode="read" target="last-update:120">Meter_Energy_Grid_Import_Timestamp</cv-address>
<span slot="title">Zählerstand Strom</span>
<span slot="unit">kWh</span>
</cv-info> I know that I have to provide documentation for this feature and also an example in the demo config but that has to wait until the next free time slot.
This makes the CometVisu pass the lighthouse test in the chrome developer tools. Benefit from that is that you see a icon the browsers address field that says "Cometvisu installieren". Also on mobile phones the system bars change their background color. You have be in a "save environment" (localhost or https) to test this, because a running serviceworker is a requirement. If you test this in source-build you have enable it with the url-parameter |
} | ||
baseUrl = window.location.origin + baseUrl; | ||
|
||
const startUrl = window.location.origin + window.location.pathname + window.location.search; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add window.location.hash
as well, so that you can start the installed visu on a sub page, when desired
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left that one out on purpose. I think most of the users will want to start with the first page. In addition to that I think that it will lead to lots of "support cases" where users that hit the install button while being on a subpage, will be confused because the "app" will not start on the start page.
Features:
WIP feature:
The rest if this PR are minor bugfixes that I have found during testing