forked from andreypopov/habpanel-widget-xiaomi-sensor_magnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxiaomi-door-window.widget.json
32 lines (32 loc) · 3.03 KB
/
xiaomi-door-window.widget.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
"template": "<style>\n.xiaomi-door-window_widget .battery_high .icon-tile.colorize{\n filter: invert(45%) sepia(100%) hue-rotate(35deg) saturate(1700%);\n-webkit-filter: invert(45%) sepia(100%) hue-rotate(35deg) saturate(1700%);\n }\n .xiaomi-door-window_widget .battery_low .icon-tile.colorize{\n filter: invert(45%) sepia(100%) hue-rotate(340deg) saturate(1700%);\n-webkit-filter: invert(45%) sepia(100%) hue-rotate(340deg) saturate(1700%);\n }\n .xiaomi-door-window_widget .battery_low span {color:red;}\n .xiaomi-door-window_widget .battery_medium .icon-tile.colorize{\n filter: invert(45%) sepia(100%) hue-rotate(20deg) saturate(1700%);\n-webkit-filter: invert(45%) sepia(100%) hue-rotate(20deg) saturate(1700%);\n }\n\n</style>\n\n\n<div class=\"xiaomi-door-window_widget\">\n\n\n <div ng-if=\"(config.sensor_label)\">{{config.sensor_label}}</div>\n\n <!--div class=\"datetime\" ng-if=\"itemValue(config.trigger_time_item) != 'N/A'\">\n {{itemValue(config.trigger_time_item) | date:'yyyy-MM-dd HH:mm:ss'}}\n </div-->\n\n <div>\n <div ng-if=\"itemValue(config.sensor_item) =='OPEN'\" data-popover-trigger=\"mouseenter\" uib-tooltip=\"{{itemValue(config.trigger_time_item) | date:'yyyy-MM-dd HH:mm:ss'}}\">\n <widget-icon iconset=\"'eclipse-smarthome-classic'\" icon=\"'lock-open'\" size=\"44\"/>\n </div>\n <div ng-if=\"itemValue(config.sensor_item) =='CLOSED'\">\n <widget-icon iconset=\"'eclipse-smarthome-classic'\" icon=\"'lock-closed'\" size=\"44\" uib-tooltip=\"{{itemValue(config.trigger_time_item) | date:'yyyy-MM-dd HH:mm:ss'}}\"/>\n </div>\n \n <div ng-if=\"itemValue(config.sensor_item) =='N/A'\" uib-tooltip=\"yyyy-MM-dd HH:mm:ss\" >\n <widget-icon iconset=\"'eclipse-smarthome-classic'\" icon=\"'lock-open'\" size=\"44\"/>\n </div>\n </div>\n\n <div ng-class=\"itemValue(config.battery_low_item) == 'ON' || itemValue(config.battery_item) <= 10 ?'battery_low':itemValue(config.battery_item) >= 50?'battery_high':'battery_medium'\" ng-if=\"(config.battery_item) && itemValue(config.battery_item) != 'N/A'\" style=\"float:right;\">\n <span ><widget-icon style=\"display:inline-block;width:20px;\"; iconset=\"'smarthome-set'\" icon=\"'power'\" size=\"14\" /></span><span style=\"font-size:12px;\">{{itemValue(config.battery_item)}}%</span>\n </div>\n</div>\n\n\n",
"author": "Popov Andrey",
"name": "Xiaomi: Door/Window",
"settings": [
{
"type": "string",
"id": "sensor_label",
"label": "Sensor: Label"
},
{
"type": "item",
"id": "sensor_item",
"label": "Sensor: Item"
},
{
"type": "item",
"id": "trigger_time_item",
"label": "Sensor: Trigger time item"
},
{
"type": "item",
"label": "Battery: Item",
"id": "battery_item"
},
{
"type": "item",
"id": "battery_low_item",
"label": "Battery Low: Item"
}
]
}