Merge pull request #10308 from s-hadinger/zigbee_fix_colors

Zigbee fix color of LQI and last seen
This commit is contained in:
Theo Arends 2020-12-29 13:52:48 +01:00 committed by GitHub
commit 90507c3463
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 70 additions and 66 deletions

View File

@ -1684,9 +1684,9 @@ const char ZB_WEB_U[] PROGMEM =
// Lighting
".bx{height:14px;width:14px;display:inline-block;border:1px solid currentColor;background-color:var(--cl,#fff)}"
// Signal Strength Indicator
".ssi{display:inline-flex;align-items:flex-end;height:15px;padding:0}"
".ssi i{width:3px;margin-right:1px;border-radius:3px;background-color:#eee}"
".ssi .b0{height:25%%}.ssi .b1{height:50%%}.ssi .b2{height:75%%}.ssi .b3{height:100%%}.o30{opacity:.3}"
".si{display:inline-flex;align-items:flex-end;height:15px;padding:0}"
".si i{width:3px;margin-right:1px;border-radius:3px;background-color:#%06x}"
".si .b0{height:25%%}.si .b1{height:50%%}.si .b2{height:75%%}.si .b3{height:100%%}.o30{opacity:.3}"
"</style>"
"\0"
@ -1739,7 +1739,7 @@ const char ZB_WEB_U[] PROGMEM =
"<tr class='ztd htr'>"
"<td><b title='0x%04X %s - %s'>%s</b></td>" // name
"<td>%s</td>" // sbatt (Battery Indicator)
"<td><div title='LQI %s' class='ssi'>" // slqi
"<td><div title='LQI %s' class='si'>" // slqi
"\0"
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
//=ZB_WEB_BATTERY
@ -1779,22 +1779,22 @@ const char ZB_WEB_U[] PROGMEM =
// ++++++++++++++++++++vvvvvvvvvvvvvvvvvvv++++++++++++++++++++
enum {
ZB_WEB_CSS=0,
ZB_WEB_PERMITJOIN_ACTIVE=512,
ZB_WEB_VIS_JS_BEFORE=566,
ZB_WEB_VIS_JS_AFTER=1039,
ZB_WEB_AUTO_REFRESH=1103,
ZB_WEB_MAP_REFRESH=1169,
ZB_WEB_STATUS_LINE=1235,
ZB_WEB_BATTERY=1344,
ZB_WEB_LAST_SEEN=1394,
ZB_WEB_COLOR_RGB=1442,
ZB_WEB_LINE_START=1502,
ZB_WEB_LIGHT_CT=1542,
ZB_WEB_END_STATUS=1597,
ZB_WEB_LINE_END=1614,
ZB_WEB_PERMITJOIN_ACTIVE=507,
ZB_WEB_VIS_JS_BEFORE=561,
ZB_WEB_VIS_JS_AFTER=1034,
ZB_WEB_AUTO_REFRESH=1098,
ZB_WEB_MAP_REFRESH=1164,
ZB_WEB_STATUS_LINE=1230,
ZB_WEB_BATTERY=1338,
ZB_WEB_LAST_SEEN=1388,
ZB_WEB_COLOR_RGB=1436,
ZB_WEB_LINE_START=1496,
ZB_WEB_LIGHT_CT=1536,
ZB_WEB_END_STATUS=1591,
ZB_WEB_LINE_END=1608,
};
// Compressed from 1631 to 1109, -32.0%
// Compressed from 1625 to 1111, -31.6%
const char ZB_WEB[] PROGMEM = "\x00\x66\x3D\x0E\xCA\xB1\xC1\x33\xF0\xF6\xD1\xEE\x3D\x3D\x46\x41\x33\xF0\xE8\x6D"
"\xA1\x15\x08\x79\xF6\x51\xDD\x3C\xCC\x6F\xFD\x47\x58\x62\xB4\x21\x0E\xF1\xED\x1F"
"\xD1\x28\x51\xE6\x72\x99\x0C\x36\x1E\x0C\x67\x51\xD7\xED\x36\xB3\xCC\xE7\x99\xF4"
@ -1805,52 +1805,52 @@ const char ZB_WEB[] PROGMEM = "\x00\x66\x3D\x0E\xCA\xB1\xC1\x33\xF0\xF6\xD1\xEE\
"\x13\x7C\x30\x2B\x32\x3C\xF7\x82\xDE\x67\x58\xE0\xB0\x33\x43\xC0\xEC\xF8\x8F\xE7"
"\x99\xC8\x43\x0D\x8B\xD8\x16\x88\x83\x17\xFF\xBE\xA2\x0F\x02\xCF\x9E\x07\x58\x66"
"\x83\xDF\xC1\x7C\x21\xD6\x1E\x05\x9F\x3C\xCC\xEF\xE7\x74\xEB\x3A\xC3\x08\xEA\x3C"
"\x8C\x18\x30\x77\x8F\x71\xD3\xDE\xD3\xDA\x09\x59\xA1\x80\x99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\xF8\x67\x04\x3E\x18\xD0\x78\x17\x86\x5F\x1F\x0F\x61\xCC"
"\x3D\x87\xE1\xFA\x3C\x96\x7B\xE7\x82\x9C\x2F\x82\x17\x45\x6C\x10\xB8\x1B\x20\xCA"
"\x91\xF4\x21\xEC\x3F\x0F\x4F\x0D\xB0\x82\x3F\x0F\xD1\xE4\x71\x7D\x7C\xF0\x77\x0F"
"\x43\xB0\x81\x06\x61\xF4\x21\x1A\x02\x17\x45\xB6\x70\xBE\x08\x5D\x06\x23\xB2\x84"
"\x3F\x0F\xAF\x1E\xD6\x7B\x81\x32\x6C\xE1\x7C";
"\x8C\x18\x30\x77\x8F\x71\xD3\xDA\x7B\x41\x2B\x33\x30\x13\x36\x1E\x2C\x2D\x1E\xE3"
"\xAF\x69\x8D\xF1\xE6\x60\x26\x6C\x3A\xDF\x08\x78\x04\x3D\xCC\xE6\x90\xC3\x61\xE0"
"\x65\x88\x26\xF0\xF1\xE6\x71\x9E\xE3\xA1\x7B\x56\x82\x17\x0A\x07\x2C\x86\x1B\x0F"
"\x2A\x01\x93\xC2\x30\xC3\x60\x21\x6F\xC7\x5F\xEC\x4D\x17\xE3\xCC\xE5\x90\xC3\x60"
"\x26\xEE\x47\x91\xF4\x71\xF1\x1B\x0F\x71\xD3\xDA\x8E\x83\x8E\x32\x04\x3E\x16\xCE"
"\x56\x9F\x47\xD1\x02\x15\x03\x90\x81\x0E\x81\xCD\x64\x08\x94\x0E\x51\x02\x1D\x03"
"\x9E\x20\x45\xC1\x0E\x59\x02\x27\x12\xE7\x1B\x3E\x8F\xA3\xDC\x74\x2C\x39\x6C\xF6"
"\x96\x0C\xB0\xF6\x8C\x8F\x33\xA1\xCB\x3D\xC7\xA1\xD8\x40\x83\xCA\x24\xE1\x7C\xF4"
"\x18\x7E\x1E\x83\x8F\xC3\xDE\x47\xA7\x86\x5F\x2F\x51\x90\x4C\xF8\x7D\x82\x16\xCE"
"\x71\xFD\x9E\x0F\xB3\xF0\xFA\x2F\x1E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xE8\x43\xE8\xFA\x04\x4E\x7F\x8E\xB3\xAC\x70\x47\x99"
"\xF4\x20\xC3\x61\xEC\x3F\x0F\x43\xB3\x4F\xC9\xC2\xF9\xE9\x42\x02\x1D\x70\x44\xE8"
"\xA7\x1C\xA2\x36\x1F\x47\x1D\x11\xB0\xFA\x38\xE8\x8D\x87\xB0\xFC\x3F\x47\x91\xB0"
"\xE4\x22\x30\x73\x77\xC7\x83\xE9\xD1\x08\x7D\x07\x38\x5F\x40\x8D\x9F\x9B\x01\x1B"
"\x32\x0C\x23\xCC\xF2\x3E\x8E\x3A\x22\x36\x1F\x47\x1D\x11\x1B\x0F\xA3\x8E\x88\x8D"
"\x80\x83\x9D\x82\x44\xF0\x47\xE1\x98\x10\xF8\x62\x41\xE0\x5E\x19\x7C\x7C\x3D\x87"
"\x30\xF6\x1F\x87\xE8\xF2\x59\xEF\x9E\x0A\x70\xBE\x08\x5D\x15\xA0\x42\xE0\x6C\x83"
"\x2A\x2B\x47\xD0\x87\xB0\xFC\x3D\x3C\x36\xC2\x08\xFC\x3F\x47\x91\xC5\xF5\xF3\xC1"
"\xDC\x3D\x0E\xC2\x04\x19\x87\xD0\x84\x68\x08\x5D\x16\xC9\xC2\xF8\x21\x74\x18\x4E"
"\xCA\x10\xFC\x3E\xBC\x7B\x59\xEE\x04\xC9\xB3\x85\xF3";
// ++++++++++++++++++++^^^^^^^^^^^^^^^^^^^++++++++++++++++++++
// ++++++++++++++++++++ DO NOT EDIT ABOVE ++++++++++++++++++++
@ -1887,7 +1887,11 @@ extern "C" {
uint32_t convert_seconds_to_dhm(uint32_t seconds, char *unit, uint8_t *color){
static uint32_t conversions[3] = {24 * 3600, 3600, 60};
static char units[3] = { 'd', 'h', 'm'}; // day, hour, minute
static uint8_t colors[3] = { 0x60, 0xA0, 0xEA};
uint8_t color_text_8 = WebColor(COL_TEXT) & 0xFF; // color of text on 8 bits
uint8_t color_back_8 = WebColor(COL_BACKGROUND) & 0xFF; // color of background on 8 bits
uint8_t colors[3] = { (uint8_t) changeUIntScale(6, 0, 16, color_back_8, color_text_8), // 6/16 of text
(uint8_t) changeUIntScale(10, 0, 16, color_back_8, color_text_8), // 10/16 of text color
color_text_8};
for(int i = 0; i < 3; ++i) {
*color = colors[i];
*unit = units[i];
@ -1915,7 +1919,7 @@ void ZigbeeShow(bool json)
if (!zigbee_num) { return; }
if (zigbee_num > 255) { zigbee_num = 255; }
WSContentSend_P(msg[ZB_WEB_CSS]);
WSContentSend_P(msg[ZB_WEB_CSS], WebColor(COL_TEXT));
// WSContentSend_compressed(ZB_WEB, 0);
// sort elements by name, then by id