Skip to content

Commit

Permalink
1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
klausahrenberg committed Jan 17, 2021
1 parent 210154f commit 301ccf9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion WNeoCoolcam/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ build_flags =
-I ../../WAdapter/WAdapter
lib_deps =
ESP8266WiFi
ottowinter/ESPAsyncWebServer-esphome@^1.2.7
https://github.com/me-no-dev/ESPAsyncWebServer
AsyncTCP
ESP8266mDNS
DNSServer
Expand Down
2 changes: 1 addition & 1 deletion WNeoCoolcam/src/WNeoCoolcam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


#define APPLICATION "Neo Coolcam"
#define VERSION "1.18"
#define VERSION "1.20"
#define FLAG_SETTINGS 0x17
#define DEBUG false

Expand Down
15 changes: 14 additions & 1 deletion WNeoCoolcam/src/WNeoDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class WNeoDevice: public WDevice {
network->addCustomPage(configPage);
//StatusLed
if (supportedDevices[getDeviceType()].statusLed != NO_PIN) {
this->statusLed = new WLed(supportedDevices[getDeviceType()].statusLed);
network->setStatusLedPin(supportedDevices[getDeviceType()].statusLed);
}
for (int i = 0; i < COUNT_MAX_RELAIS; i++) {
if (supportedDevices[getDeviceType()].relayPins[i] != NO_PIN) {
Expand All @@ -81,6 +81,17 @@ class WNeoDevice: public WDevice {
//Property
onOffProperty = WProperty::createOnOffProperty(pN.c_str(), pD.c_str());
this->addProperty(onOffProperty);
//toggle property
pN = "trigger";
pD = "Trigger";
if (i > 0) {
pN.concat(i + 1);
pD.concat(" ");
pD.concat(i + 1);
}
triggerProperty = WProperty::createOnOffProperty(pN.c_str(), pD.c_str());
triggerProperty->setVisibility(MQTT);
this->addProperty(triggerProperty);
if (getDeviceMode() != MODE_NO_RELAY_USAGE) {
//Relay
pN = "relay";
Expand Down Expand Up @@ -109,6 +120,7 @@ class WNeoDevice: public WDevice {
//If more buttons than relais, than assign all buttons to last relay, e.g. SonoffBasic
WSwitch* button = new WSwitch(supportedDevices[getDeviceType()].switchPins[i], supportedDevices[getDeviceType()].switchModes[i]);
button->setProperty(onOffProperty);
button->setTriggerProperty(triggerProperty);
this->addPin(button);
}

Expand Down Expand Up @@ -207,6 +219,7 @@ class WNeoDevice: public WDevice {
WProperty* ledProgram;
W2812Led* ledStrip;
WProperty* onOffProperty;
WProperty* triggerProperty;
WProperty* mainLedRelay;
WProperty* showAsWebthingDevice;
};
Expand Down
Binary file renamed WNeoCoolcam_1.18.bin → WNeoCoolcam_1.20.bin
Binary file not shown.

0 comments on commit 301ccf9

Please sign in to comment.