-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
|
||
#### Switch (switch) | ||
|
||
|
@@ -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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure this addition was necessary to be emphasized here tbh :) |
||
|
||
#### Chart (chart) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,21 @@ | |
vm.value = "N/A"; | ||
return; | ||
} | ||
var value = item.transformedState || item.state; | ||
|
||
if (vm.widget.usedescription) { | ||
var options = item.stateDescription.options; | ||
if (Array.isArray(options)) { | ||
var option = options.find((element) => element.value === item.state); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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+, Reference It could probably be chenged to There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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). Thank you for reporting that late minute bug. |
||
if (option) { | ||
var value = option.label; | ||
} else { | ||
var value = item.state; | ||
} | ||
} | ||
} else { | ||
var value = item.transformedState || item.state; | ||
} | ||
|
||
if (vm.widget.format) { | ||
if (item.type === "DateTime" || item.type === "DateTimeItem") { | ||
value = $filter('date')(value, vm.widget.format); | ||
|
@@ -105,7 +119,9 @@ | |
icon : widget.icon, | ||
icon_size : widget.icon_size, | ||
icon_nolinebreak : widget.icon_nolinebreak, | ||
icon_replacestext: widget.icon_replacestext | ||
icon_replacestext: widget.icon_replacestext, | ||
value_color : widget.value_color, | ||
usedescription : widget.usedescription | ||
}; | ||
|
||
$scope.dismiss = function() { | ||
|
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.