mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 11:46:31 +00:00
Merge pull request #6681 from baschdello/development
Fixes functionality of command Sensor20 for NovaSDS
This commit is contained in:
commit
f8104cacdd
@ -348,7 +348,7 @@ struct SYSCFG {
|
|||||||
uint8_t rgbwwTable[5]; // 71A
|
uint8_t rgbwwTable[5]; // 71A
|
||||||
uint8_t user_template_base; // 71F
|
uint8_t user_template_base; // 71F
|
||||||
mytmplt user_template; // 720 29 bytes
|
mytmplt user_template; // 720 29 bytes
|
||||||
uint8_t novasds_period; // 73D
|
uint8_t novasds_startingoffset; // 73D
|
||||||
uint8_t web_color[18][3]; // 73E
|
uint8_t web_color[18][3]; // 73E
|
||||||
uint16_t display_width; // 774
|
uint16_t display_width; // 774
|
||||||
uint16_t display_height; // 776
|
uint16_t display_height; // 776
|
||||||
|
@ -849,7 +849,7 @@ void SettingsDefaultSet2(void)
|
|||||||
Settings.rgbwwTable[j] = 255;
|
Settings.rgbwwTable[j] = 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
Settings.novasds_period = WORKING_PERIOD;
|
Settings.novasds_startingoffset = STARTING_OFFSET;
|
||||||
|
|
||||||
SettingsDefaultWebColor();
|
SettingsDefaultWebColor();
|
||||||
|
|
||||||
@ -1102,7 +1102,7 @@ void SettingsDelta(void)
|
|||||||
Settings.param[P_RGB_REMAP] = RGB_REMAP_RGBW;
|
Settings.param[P_RGB_REMAP] = RGB_REMAP_RGBW;
|
||||||
}
|
}
|
||||||
if (Settings.version < 0x06050003) {
|
if (Settings.version < 0x06050003) {
|
||||||
Settings.novasds_period = WORKING_PERIOD;
|
Settings.novasds_startingoffset = STARTING_OFFSET;
|
||||||
}
|
}
|
||||||
if (Settings.version < 0x06050006) {
|
if (Settings.version < 0x06050006) {
|
||||||
SettingsDefaultWebColor();
|
SettingsDefaultWebColor();
|
||||||
|
@ -151,7 +151,7 @@ void NovaSdsSecond(void) // Every second
|
|||||||
NovaSdsSetWorkPeriod();
|
NovaSdsSetWorkPeriod();
|
||||||
novasds_valid=1;
|
novasds_valid=1;
|
||||||
}
|
}
|
||||||
if((Settings.tele_period - STARTING_OFFSET <= 0))
|
if((Settings.tele_period - Settings.novasds_startingoffset <= 0))
|
||||||
{
|
{
|
||||||
if(!cont_mode)
|
if(!cont_mode)
|
||||||
{ //switched to continuous mode
|
{ //switched to continuous mode
|
||||||
@ -162,7 +162,7 @@ void NovaSdsSecond(void) // Every second
|
|||||||
else
|
else
|
||||||
cont_mode = 0;
|
cont_mode = 0;
|
||||||
|
|
||||||
if(tele_period == Settings.tele_period - STARTING_OFFSET && !cont_mode)
|
if(tele_period == Settings.tele_period - Settings.novasds_startingoffset && !cont_mode)
|
||||||
{ //lets start fan and laser
|
{ //lets start fan and laser
|
||||||
NovaSdsCommand(NOVA_SDS_SLEEP_AND_WORK, NOVA_SDS_SET_MODE, NOVA_SDS_WORK, NOVA_SDS_DEVICE_ID, nullptr);
|
NovaSdsCommand(NOVA_SDS_SLEEP_AND_WORK, NOVA_SDS_SET_MODE, NOVA_SDS_WORK, NOVA_SDS_DEVICE_ID, nullptr);
|
||||||
}
|
}
|
||||||
@ -191,10 +191,10 @@ void NovaSdsSecond(void) // Every second
|
|||||||
bool NovaSdsCommandSensor(void)
|
bool NovaSdsCommandSensor(void)
|
||||||
{
|
{
|
||||||
if ((XdrvMailbox.payload > 0) && (XdrvMailbox.payload < 256)) {
|
if ((XdrvMailbox.payload > 0) && (XdrvMailbox.payload < 256)) {
|
||||||
Settings.novasds_period = XdrvMailbox.payload;
|
if( XdrvMailbox.payload < 10 ) Settings.novasds_startingoffset = 10;
|
||||||
NovaSdsSetWorkPeriod();
|
else Settings.novasds_startingoffset = XdrvMailbox.payload;
|
||||||
}
|
}
|
||||||
Response_P(S_JSON_SENSOR_INDEX_NVALUE, XSNS_20, Settings.novasds_period);
|
Response_P(S_JSON_SENSOR_INDEX_NVALUE, XSNS_20, Settings.novasds_startingoffset);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user