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

Dummy and Clock widget improvements #1380

Merged
merged 3 commits into from
Jun 23, 2022
Merged

Dummy and Clock widget improvements #1380

merged 3 commits into from
Jun 23, 2022

Conversation

BasvanH
Copy link
Contributor

@BasvanH BasvanH commented Apr 29, 2022

Signed-off-by: Bastiaan an Haastrecht b.vanhaastrecht@gmail.com
Adds color customization to Clock and Dummy widget.
Adds option to show state description in Dummy widget.

Closes: #1349
Closes: #1293
Closes: #1294

BasvanH added 2 commits April 19, 2022 17:55
Signed-off-by: Bastiaan van Haastrecht b.vanhaastrecht@gmail.com
Closes: openhab#1349
@BasvanH BasvanH requested a review from ghys as a code owner April 29, 2022 07:35
Copy link
Member

@ghys ghys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks, this looks quite good (especially the i18n stuff), a few minor remarks on the docs, but LGTM.

@@ -168,7 +168,7 @@ The following built-in widgets are available:

![Dummy widget](images/habpanel_widget-dummy.png)

The so-called dummy widget (whose name is explained by historical reasons - it evolved from the first developed widget) displays the current state of an item without any interactivity, along with a label and an optional icon.
The so-called dummy widget (whose name is explained by historical reasons - it evolved from the first developed widget) displays the current state of an item without any interactivity, along with a label and an optional icon. It has a few options to customize it's appeareance.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The so-called dummy widget (whose name is explained by historical reasons - it evolved from the first developed widget) displays the current state of an item without any interactivity, along with a label and an optional icon. It has a few options to customize it's appeareance.
The so-called dummy widget (whose name is explained by historical reasons - it evolved from the first developed widget) displays the current state of an item without any interactivity, along with a label and an optional icon. It has a few options to customize its appeareance.

@@ -230,7 +230,7 @@ The frame widget displays an external web page in a HTML `<iframe>`.

![Clock widget](images/habpanel_widget-clock.png)

The clock widget displays an analog or digital clock. It can also be used to display the current date.
The clock widget displays an analog or digital clock with color customization. It can also be used to display the current date.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this addition was necessary to be emphasized here tbh :)

Signed-off-by: Yannick Schaus <github@schaus.net>
Copy link
Member

@ghys ghys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging this small change as non disruptive, besides it was positively reviewed a while ago and I was just waiting for feedback on my doc changes which I ended up reverting yesterday.

@ghys ghys merged commit 3e7f49b into openhab:main Jun 23, 2022
@ghys ghys added enhancement New feature or request habpanel ui labels Jun 23, 2022
@ghys ghys added this to the 3.3 milestone Jun 23, 2022
@jsiemon
Copy link

jsiemon commented Jun 25, 2022

The changes made between M7 and RC1 seem to have broken the Dummy Widget when implemented with HabPanel and used on an iPad 3 or earlier. IPad 4and later seem unaffected. I believe many, not all, HabPanel users use older hardware, otherwise they would likely use MainUI instead of HabPanel. I view this as a regression for a feature implemented after the features were frozen.

@kaikreuzer
Copy link
Member

@ghys Can you confirm that those changes might have increased the minimal browser requirements?
I leave it to your judgement on whether this is something that we can live with or if there's any need to act.

@jsiemon
Copy link

jsiemon commented Jun 25, 2022 via email

if (vm.widget.usedescription) {
var options = item.stateDescription.options;
if (Array.isArray(options)) {
var option = options.find((element) => element.value === item.state);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably the line that is causing problems (arrow functions are iOS Safari 10+, find is iOS Safari 8+).
The iPad 3 apparently runs on iOS 9.

Reference
https://caniuse.com/arrow-functions
https://caniuse.com/array-find
https://en.wikipedia.org/wiki/IPad_(3rd_generation)#Software

It could probably be chenged to options.find((function (element) { return element.value === item.state; }) to make it compatible with iOS 8+.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be great if it can be fixed as proposed. I know this is old hardware, but it works great with HabPanel otherwise and HabPanel is a great legacy alternative to the new MainUI that does require more modern hardware to run. Your efforts are greatly appreciated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1433 reimplements the code with techniques found elsewhere (and it seems to work in iOS 6).

image

Thank you for reporting that late minute bug.

ghys added a commit to ghys/openhab-webui that referenced this pull request Jun 25, 2022
openhab#1380 introduced new code with ES6 syntax (arrow functions) that isn't supported in older browsers.
See openhab#1380 (comment)

Reimplement using the code from the selection widget to determine the option
(uses angularJS helpers)

Signed-off-by: Yannick Schaus <github@schaus.net>
ghys added a commit that referenced this pull request Jun 26, 2022
#1380 introduced new code with ES6 syntax (arrow functions) that isn't supported in older browsers.
See #1380 (comment)

Reimplement using the code from the selection widget to determine the option
(uses angularJS helpers)

Signed-off-by: Yannick Schaus <github@schaus.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request habpanel ui
Projects
None yet
4 participants