Skip to content

Commit

Permalink
Merge pull request Dashticz#834 from HansieNL/beta
Browse files Browse the repository at this point in the history
Multicolor Selector Switch
  • Loading branch information
lokonli authored Apr 12, 2021
2 parents 45b9dae + 63e588e commit 214db18
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions docs/blocks/specials/dial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -552,3 +552,64 @@ Hide extra data::
.dial[data-id='dial_name'] .extra {
display: none;
}


Examples
---------

**Multicolor Selector Switch**

.. image :: img/multicolor_selector_switch.png
CONFIG.js::

blocks['selector_switch'] = {
idx: 123,
type: 'dial',
width: 5,
}
columns[1] = {}
columns[1]['blocks'] = ['selector_switch']
columns[1]['width'] = 5;

custom.js::

function deviceHook(device) {
if (device.idx==123) {
var level=parseInt(device.Level);
device.deviceStatus='level'+level
}
}

custom.css::

/*ring color*/
.level10 .dial-center {
box-shadow: 0 0 25px 1px green !important;
}

/*selected item color*/
.level10 .status {
--dial-color: green !important
}

/*ring color*/
.level20 .dial-center {
box-shadow: 0 0 25px 1px red !important;
}

/*selected item color*/
.level20 .status {
--dial-color: red !important
}

/*ring color*/
.level30 .dial-center {
box-shadow: 0 0 25px 1px blue !important;
}

/*selected item color*/
.level30 .status {
--dial-color: blue !important
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 214db18

Please sign in to comment.