From 138ed6def98160b2f86dbbab8db8f0319c97b7c1 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 4 Sep 2019 12:58:37 +0200 Subject: [PATCH] Refactoring Refactoring --- sonoff/sonoff.ino | 8 ++++---- sonoff/xdrv_01_webserver.ino | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index a06dd1170..abe71d647 100755 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -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); @@ -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) { 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 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; } -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 // state 0 = POWER_OFF = Relay Off diff --git a/sonoff/xdrv_01_webserver.ino b/sonoff/xdrv_01_webserver.ino index c50bef2da..01f5cde34 100644 --- a/sonoff/xdrv_01_webserver.ino +++ b/sonoff/xdrv_01_webserver.ino @@ -500,7 +500,7 @@ static bool WifiIsInManagerMode(){ 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)) { 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); ExecuteCommand(svalue, SRC_IGNORE);