Skip to content

Commit 137c434

Browse files
committed
Merge pull request arduino#179 from barduinor/development
Minor fixes, Only S_DOOR and V_ARMED active
2 parents f6cb24d + 875875a commit 137c434

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

libraries/MySensors/examples/MockMySensors/MockMySensors.ino

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@
6969
//#define ID_S_CUSTOM 99
7070

7171
// Global Vars
72-
unsigned long SLEEP_TIME = 180000; // Sleep time between reads (in milliseconds)
72+
unsigned long SLEEP_TIME = 300000; // Sleep time between reads (in milliseconds)
7373
boolean metric = true;
7474
long randNumber;
7575

7676
// Instanciate MySersors Gateway
77-
MyTransportNRF24 transport(RF24_CE_PIN, RF24_CS_PIN, RF24_PA_LEVEL_GW);
77+
MyTransportNRF24 transport(RF24_CE_PIN, RF24_CS_PIN, RF24_PA_LEVEL);
7878
//MyTransportRFM69 transport;
7979

8080
// Message signing driver (signer needed if MY_SIGNING_FEATURE is turned on in MyConfig.h)
@@ -130,7 +130,7 @@ MyHwATMega328 hw;
130130
MyMessage msg_S_COVER_U(ID_S_COVER,V_UP);
131131
MyMessage msg_S_COVER_D(ID_S_COVER,V_DOWN);
132132
MyMessage msg_S_COVER_S(ID_S_COVER,V_STOP);
133-
const char* coverVal = "V_STOP";
133+
const char* coverVal = "V_STOP"; //compiler warnings
134134
#endif
135135

136136
#ifdef ID_S_TEMP
@@ -216,7 +216,7 @@ MyHwATMega328 hw;
216216
MyMessage msg_S_SCENE_CONTROLLER_ON(ID_S_SCENE_CONTROLLER,V_SCENE_ON);
217217
MyMessage msg_S_SCENE_CONTROLLER_OF(ID_S_SCENE_CONTROLLER,V_SCENE_OFF);
218218
// not sure if scene controller sends int or chars
219-
// betting on ints as Touch Display Scen by Hek
219+
// betting on ints as Touch Display Scen by Hek // compiler warnings
220220
char *scenes[] = {
221221
"All off",
222222
"Good Morning",
@@ -309,7 +309,7 @@ void setup()
309309
#endif
310310

311311
#ifdef ID_S_TEMP
312-
Serial.println(" S_TMEP");
312+
Serial.println(" S_TEMP");
313313
gw.present(ID_S_TEMP,S_TEMP);
314314
gw.wait(SHORT_WAIT);
315315
#endif
@@ -649,7 +649,7 @@ void cover(){
649649
if (coverVal == "V_UP"){
650650
Serial.println("Opening");
651651
gw.send(msg_S_COVER_U.set(V_UP));
652-
}else if (coverVal == "V_DONW"){
652+
}else if (coverVal == "V_DOWN"){
653653
Serial.println("Closing");
654654
gw.send(msg_S_COVER_D.set(V_DOWN));
655655
}else{
@@ -686,7 +686,7 @@ void hum(){
686686
void baro(){
687687

688688
const char *weather[] = {"stable","sunny","cloudy","unstable","thunderstorm","unknown"};
689-
long pressure = map(randNumber,1,100,87000,108600);
689+
long pressure = map(randNumber,1,100,870,1086);// hPa?
690690
int forecast = map(randNumber,1,100,0,5);
691691

692692
Serial.print("Atmosferic Pressure is: " );
@@ -924,6 +924,7 @@ void incomingMessage(const MyMessage &message) {
924924
Serial.print(message.sensor);
925925
Serial.print(", New status: ");
926926
Serial.println((isArmed ? "Armed":"Disarmed" ));
927+
door();//temp ack for door
927928
break;
928929
#endif
929930

@@ -934,7 +935,7 @@ void incomingMessage(const MyMessage &message) {
934935
Serial.print(message.sensor);
935936
Serial.print(", New status: ");
936937
Serial.println((isLightOn ? "On":"Off"));
937-
light();
938+
light(); // temp ack
938939
break;
939940
#endif
940941

@@ -1004,6 +1005,7 @@ void incomingMessage(const MyMessage &message) {
10041005
Serial.print(message.sensor);
10051006
Serial.print(", New status: ");
10061007
Serial.println(message.getBool()?"Locked":"Unlocked");
1008+
lock(); //temp ack
10071009
break;
10081010
#endif
10091011

0 commit comments

Comments
 (0)