Skip to content

Commit

Permalink
Allow inversion of input GPIO (#997)
Browse files Browse the repository at this point in the history
* Allow inversion of input GPIO

* Fix formatting
  • Loading branch information
qistoph authored Jun 26, 2021
1 parent 90f4299 commit d2ff32d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main/ZmqttDiscovery.ino
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ void pubMqttDiscovery() {

# ifdef ZsensorGPIOInput
Log.trace(F("GPIOInputDiscovery" CR));
char* GPIOInputsensor[8] = {"binary_sensor", "GPIOInput", "", "", jsonGpio, "HIGH", "LOW", ""};
char* GPIOInputsensor[8] = {"binary_sensor", "GPIOInput", "", "", jsonGpio, INPUT_GPIO_ON_VALUE, INPUT_GPIO_OFF_VALUE, ""};
//component type,name,availability topic,device class,value template,payload on, payload off, unit of measurement

Log.trace(F("CreateDiscoverySensor" CR));
Expand Down
3 changes: 3 additions & 0 deletions main/config_GPIOInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@ extern void GPIOInputtoMQTT();
# endif
#endif

#define INPUT_GPIO_ON_VALUE "HIGH"
#define INPUT_GPIO_OFF_VALUE "LOW"

#endif

0 comments on commit d2ff32d

Please sign in to comment.