mirror of https://github.com/arendst/Tasmota.git
ZIgbee add GP UI indicator
This commit is contained in:
parent
2cca11f54b
commit
c73d783554
|
@ -734,7 +734,7 @@ public:
|
|||
// other status - device wide data is 8 bytes
|
||||
// START OF DEVICE WIDE DATA
|
||||
uint32_t last_seen; // Last seen time (epoch)
|
||||
uint32_t batt_last_seen; // Time when we last received battery status (epoch), 0 means unknown, 0xFFFFFFFF means that the device has no battery
|
||||
uint32_t batt_last_seen; // Time when we last received battery status (epoch), 0 means unknown, 0xFFFFFFFF means that the device has no battery, 0xFFFFFFFE means the device is Green Power, all values above 0xFFFFFFF0 are reserved
|
||||
uint32_t batt_last_probed; // Time when the device was last probed for batteyr values
|
||||
uint8_t lqi; // lqi from last message, 0xFF means unknown
|
||||
uint8_t batt_percent; // battery percentage (0..100), 0xFF means unknwon
|
||||
|
@ -783,7 +783,7 @@ public:
|
|||
inline bool validLqi(void) const { return 0xFF != lqi; }
|
||||
inline bool validBatteryPercent(void) const { return 0xFF != batt_percent; }
|
||||
inline bool validLastSeen(void) const { return 0x0 != last_seen; }
|
||||
inline bool validBattLastSeen(void) const { return (0x0 != batt_last_seen) && (0xFFFFFFFF != batt_last_seen); }
|
||||
inline bool validBattLastSeen(void) const { return (0x0 != batt_last_seen) && (batt_last_seen < 0xFFFFFFF0); }
|
||||
|
||||
inline void setReachable(bool _reachable) { reachable = _reachable; }
|
||||
inline bool getReachable(void) const { return reachable; }
|
||||
|
@ -806,7 +806,9 @@ public:
|
|||
}
|
||||
}
|
||||
inline void setHasNoBattery(void) { batt_last_seen = 0xFFFFFFFF; }
|
||||
inline bool hasNoBattery(void) const { return 0xFFFFFFFF == batt_last_seen; }
|
||||
inline bool hasNoBattery(void) const { return batt_last_seen >= 0xFFFFFFF0; }
|
||||
inline void setGP(void) { batt_last_seen = 0xFFFFFFFE; } // Green Power
|
||||
inline bool isGP(void) const { return 0xFFFFFFFE == batt_last_seen; }
|
||||
|
||||
// Add an endpoint to a device
|
||||
bool addEndpoint(uint8_t endpoint);
|
||||
|
|
|
@ -1872,6 +1872,10 @@ const char ZB_WEB_U[] PROGMEM =
|
|||
"<i class=\"bt\" title=\"%d%%%s\" style=\"--bl:%dpx;color:#%02x%02x%02x\"></i>"
|
||||
"\0"
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
//=ZB_WEB_GP
|
||||
"<span title='Green Power' style='color:#4F4;'>GP</span>"
|
||||
"\0"
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
//=ZB_WEB_LAST_SEEN
|
||||
"<td style=\"color:#%02x%02x%02x\">🕗%02d%c"
|
||||
"\0"
|
||||
|
@ -1911,16 +1915,17 @@ enum {
|
|||
ZB_WEB_MAP_REFRESH=1164,
|
||||
ZB_WEB_STATUS_LINE=1230,
|
||||
ZB_WEB_BATTERY=1338,
|
||||
ZB_WEB_LAST_SEEN=1410,
|
||||
ZB_WEB_COLOR_RGB=1458,
|
||||
ZB_WEB_LINE_START=1518,
|
||||
ZB_WEB_LIGHT_CT=1558,
|
||||
ZB_WEB_END_STATUS=1613,
|
||||
ZB_WEB_LINE_END=1630,
|
||||
ZB_WEB_GP=1410,
|
||||
ZB_WEB_LAST_SEEN=1466,
|
||||
ZB_WEB_COLOR_RGB=1514,
|
||||
ZB_WEB_LINE_START=1574,
|
||||
ZB_WEB_LIGHT_CT=1614,
|
||||
ZB_WEB_END_STATUS=1669,
|
||||
ZB_WEB_LINE_END=1686,
|
||||
};
|
||||
|
||||
// Compressed from 1649 to 1124, -31.8%
|
||||
const char ZB_WEB[] PROGMEM = "\x00\x68\x3D\x0E\xCA\xB1\xC1\x33\xF0\xF6\xD1\xEE\x3D\x3D\x46\x41\x33\xF0\xE8\x6D"
|
||||
// Compressed from 1705 to 1156, -32.2%
|
||||
const char ZB_WEB[] PROGMEM = "\x00\x6B\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"
|
||||
"\x7D\x1E\xE2\x04\x3C\x40\x2B\x04\x3C\x28\x10\xB0\x93\x99\xA4\x30\xD8\x08\x36\x8E"
|
||||
|
@ -1968,15 +1973,16 @@ const char ZB_WEB[] PROGMEM = "\x00\x68\x3D\x0E\xCA\xB1\xC1\x33\xF0\xF6\xD1\xEE\
|
|||
"\x35\x16\xA3\xEB\xC7\xD8\x21\xE7\x1E\xD3\xEC\xFC\x9C\x2F\x9E\x9A\x08\x52\xCF\x60"
|
||||
"\xEA\x3D\x80\x85\x82\x9E\xC3\xE8\x43\xE8\xFA\x3E\xBC\x08\x9D\x2A\x01\x03\xAC\xEB"
|
||||
"\x1C\x11\xE6\x7D\x08\x30\xD8\x08\x7C\xFA\x1F\x47\x1D\x11\xB0\xFA\x38\xE8\x8D\x87"
|
||||
"\xD1\xC7\x44\x6C\x3D\x87\xE1\xE8\x76\x69\xF9\x38\x5F\x3D\x28\x40\x43\xC2\xC1\x43"
|
||||
"\x01\x3F\x47\x91\xB0\xE4\x22\x30\x73\x77\xC7\x83\xE9\xD1\x08\x7D\x07\x38\x5F\x40"
|
||||
"\x8D\xAA\x9B\x01\x1B\x46\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\xF0\x10\xF8\x78\x41\xE0\x5E"
|
||||
"\x19\x7C\x7C\x3D\x87\x30\xF6\x1F\x87\xE8\xF2\x59\xEF\x9E\x0A\x70\xBE\x08\x5D\x17"
|
||||
"\x2A\x01\x42\xE0\xC4\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\x18\x29"
|
||||
"\xC2\xF8\x21\x74\x1D\xCE\xCA\x10\xFC\x3E\xBC\x7B\x59\xEE\x9C\x2F\x82\x3F\x4E\xE8"
|
||||
"\x10\x79\x39\x9C\x2F\x9B";
|
||||
"\xD1\xC7\x44\x6C\x3D\x87\xE1\xE8\x76\x69\xF9\x38\x5F\x04\x1E\x86\xD8\x21\x68\xA4"
|
||||
"\x3D\xF6\xF9\x10\xCC\x1F\x7F\x3E\xC1\x2B\xA1\xDE\x73\x08\x8C\x1C\xC3\xC1\xF6\x7E"
|
||||
"\x11\x0F\x10\xC0\x42\xE8\x77\xCE\x17\xCF\x4A\x10\x10\xF4\x30\x50\xCE\x4F\xD1\xE4"
|
||||
"\x6C\x39\x08\x8C\x1C\xDD\xF1\xE0\xFA\x74\x42\x1F\x41\xCE\x17\xD0\x23\x70\x1A\x6C"
|
||||
"\x04\x6D\xF8\x30\x8F\x33\xC8\xFA\x38\xE8\x88\xD8\x7D\x1C\x74\x44\x6C\x3E\x8E\x3A"
|
||||
"\x22\x36\x02\x0E\xE6\x09\x13\xC1\x1F\x8B\x40\x43\xE2\xC1\x07\x81\x78\x65\xF1\xF0"
|
||||
"\xF6\x1C\xC3\xD8\x7E\x1F\xA3\xC9\x67\xBE\x78\x29\xC2\xF8\x21\x74\x6A\x01\x0B\x86"
|
||||
"\x92\x0C\xA9\x1F\x42\x1E\xC3\xF0\xF4\xF0\xDB\x08\x23\xF0\xFD\x1E\x47\x17\xD7\xCF"
|
||||
"\x07\x70\xF4\x3B\x08\x10\x66\x1F\x42\x11\xA0\x22\x70\x4E\x08\x3D\x0A\xF3\xB2\x84"
|
||||
"\x3F\x0F\xAF\x1E\xD6\x7B\xA7\x0B\xE0\x8F\xD3\xF2\x04\x1E\x5C\x67\x0B\xE6";
|
||||
|
||||
// ++++++++++++++++++++^^^^^^^^^^^^^^^^^^^++++++++++++++++++++
|
||||
// ++++++++++++++++++++ DO NOT EDIT ABOVE ++++++++++++++++++++
|
||||
|
@ -2136,6 +2142,8 @@ void ZigbeeShow(bool json)
|
|||
changeUIntScale(device.batt_percent, 0, 100, 0, 14),
|
||||
(color & 0xFF0000) >> 16, (color & 0x00FF00) >> 8, (color & 0x0000FF)
|
||||
);
|
||||
} else if (device.isGP()) { // display GP in green for Green Power
|
||||
snprintf_P(sbatt, sizeof(sbatt), msg[ZB_WEB_GP]);
|
||||
}
|
||||
uint32_t num_bars = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue