mirror of
https://github.com/arendst/Tasmota.git
synced 2025-08-03 16:07:43 +00:00
Merge pull request #6494 from s-hadinger/minor_fixes
Minor fixes to Hue Emulation and Light
This commit is contained in:
commit
130117cd44
@ -2281,7 +2281,7 @@ void CmndChannel(void)
|
|||||||
light_controller.changeChannels(Light.current_color);
|
light_controller.changeChannels(Light.current_color);
|
||||||
coldim = true;
|
coldim = true;
|
||||||
}
|
}
|
||||||
ResponseCmndIdxNumber(Light.current_color[XdrvMailbox.index -1] * 100 / 255);
|
ResponseCmndIdxNumber(changeUIntScale(Light.current_color[XdrvMailbox.index -1],0,255,0,100));
|
||||||
if (coldim) {
|
if (coldim) {
|
||||||
LightPreparePower();
|
LightPreparePower();
|
||||||
}
|
}
|
||||||
|
@ -364,12 +364,15 @@ void HueLightStatus2(uint8_t device, String *response)
|
|||||||
char fname[33];
|
char fname[33];
|
||||||
strcpy(fname, Settings.friendlyname[MAX_FRIENDLYNAMES-1]);
|
strcpy(fname, Settings.friendlyname[MAX_FRIENDLYNAMES-1]);
|
||||||
uint32_t fname_len = strlen(fname);
|
uint32_t fname_len = strlen(fname);
|
||||||
if (fname_len >= 33-3) {
|
if (fname_len > 30) { fname_len = 30; }
|
||||||
fname[33-3] = 0x00;
|
|
||||||
fname_len = 33-3;
|
|
||||||
}
|
|
||||||
fname[fname_len++] = '-';
|
fname[fname_len++] = '-';
|
||||||
fname[fname_len++] = '0' + device - MAX_FRIENDLYNAMES;
|
if (device - MAX_FRIENDLYNAMES < 10) {
|
||||||
|
fname[fname_len++] = '0' + device - MAX_FRIENDLYNAMES;
|
||||||
|
} else {
|
||||||
|
fname[fname_len++] = 'A' + device - MAX_FRIENDLYNAMES - 10;
|
||||||
|
}
|
||||||
|
fname[fname_len] = 0x00;
|
||||||
|
|
||||||
response->replace("{j1", fname);
|
response->replace("{j1", fname);
|
||||||
}
|
}
|
||||||
response->replace("{j2", GetHueDeviceId(device));
|
response->replace("{j2", GetHueDeviceId(device));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user