mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-28 21:26:33 +00:00
Refactoring
Refactoring
This commit is contained in:
parent
1304252d08
commit
138ed6def9
@ -303,7 +303,7 @@ void SetLatchingRelay(power_t lpower, uint32_t state)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetDevicePower(power_t rpower, int source)
|
void SetDevicePower(power_t rpower, uint32_t source)
|
||||||
{
|
{
|
||||||
ShowSource(source);
|
ShowSource(source);
|
||||||
|
|
||||||
@ -364,7 +364,7 @@ void SetDevicePower(power_t rpower, int source)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RestorePower(bool publish_power, int source)
|
void RestorePower(bool publish_power, uint32_t source)
|
||||||
{
|
{
|
||||||
if (power != last_power) {
|
if (power != last_power) {
|
||||||
SetDevicePower(last_power, source);
|
SetDevicePower(last_power, source);
|
||||||
@ -374,7 +374,7 @@ void RestorePower(bool publish_power, int source)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetAllPower(uint32_t state, int source)
|
void SetAllPower(uint32_t state, uint32_t source)
|
||||||
{
|
{
|
||||||
// state 0 = POWER_OFF = Relay Off
|
// state 0 = POWER_OFF = Relay Off
|
||||||
// state 1 = POWER_ON = Relay On (turn off after Settings.pulse_timer * 100 mSec if enabled)
|
// state 1 = POWER_ON = Relay On (turn off after Settings.pulse_timer * 100 mSec if enabled)
|
||||||
@ -528,7 +528,7 @@ bool SendKey(uint32_t key, uint32_t device, uint32_t state)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExecuteCommandPower(uint32_t device, uint32_t state, int source)
|
void ExecuteCommandPower(uint32_t device, uint32_t state, uint32_t source)
|
||||||
{
|
{
|
||||||
// device = Relay number 1 and up
|
// device = Relay number 1 and up
|
||||||
// state 0 = POWER_OFF = Relay Off
|
// state 0 = POWER_OFF = Relay Off
|
||||||
|
@ -500,7 +500,7 @@ static bool WifiIsInManagerMode(){
|
|||||||
return (HTTP_MANAGER == Web.state || HTTP_MANAGER_RESET_ONLY == Web.state);
|
return (HTTP_MANAGER == Web.state || HTTP_MANAGER_RESET_ONLY == Web.state);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShowWebSource(int source)
|
void ShowWebSource(uint32_t source)
|
||||||
{
|
{
|
||||||
if ((source > 0) && (source < SRC_MAX)) {
|
if ((source > 0) && (source < SRC_MAX)) {
|
||||||
char stemp1[20];
|
char stemp1[20];
|
||||||
@ -508,7 +508,7 @@ void ShowWebSource(int source)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExecuteWebCommand(char* svalue, int source)
|
void ExecuteWebCommand(char* svalue, uint32_t source)
|
||||||
{
|
{
|
||||||
ShowWebSource(source);
|
ShowWebSource(source);
|
||||||
ExecuteCommand(svalue, SRC_IGNORE);
|
ExecuteCommand(svalue, SRC_IGNORE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user