Skip to content

Commit 1e104bd

Browse files
committed
Compile time option for PIR sensor off timer
1 parent 8143be2 commit 1e104bd

File tree

2 files changed

+512
-539
lines changed

2 files changed

+512
-539
lines changed

usermods/PIR_sensor_switch/readme.md

+7-39
Original file line numberDiff line numberDiff line change
@@ -23,44 +23,7 @@ You can also use usermod's off timer instead of sensor's. In such case rotate th
2323

2424
## Usermod installation
2525

26-
1. Copy the file `usermod_PIR_sensor_switch.h` to the `wled00` directory.
27-
2. Register the usermod by adding `#include "usermod_PIR_sensor_switch.h"` in the top and `registerUsermod(new PIRsensorSwitch());` in the bottom of `usermods_list.cpp`.
28-
29-
Example **usermods_list.cpp**:
30-
31-
```cpp
32-
#include "wled.h"
33-
/*
34-
* Register your v2 usermods here!
35-
* (for v1 usermods using just usermod.cpp, you can ignore this file)
36-
*/
37-
38-
/*
39-
* Add/uncomment your usermod filename here (and once more below)
40-
* || || ||
41-
* \/ \/ \/
42-
*/
43-
//#include "usermod_v2_example.h"
44-
//#include "usermod_temperature.h"
45-
//#include "usermod_v2_empty.h"
46-
#include "usermod_PIR_sensor_switch.h"
47-
48-
void registerUsermods()
49-
{
50-
/*
51-
* Add your usermod class name here
52-
* || || ||
53-
* \/ \/ \/
54-
*/
55-
//usermods.add(new MyExampleUsermod());
56-
//usermods.add(new UsermodTemperature());
57-
//usermods.add(new UsermodRenameMe());
58-
usermods.add(new PIRsensorSwitch());
59-
60-
}
61-
```
62-
63-
**NOTE:** Usermod has been included in master branch of WLED so it can be compiled in directly just by defining `-D USERMOD_PIRSWITCH` and optionaly `-D PIR_SENSOR_PIN=16` to override default pin.
26+
**NOTE:** Usermod has been included in master branch of WLED so it can be compiled in directly just by defining `-D USERMOD_PIRSWITCH` and optionaly `-D PIR_SENSOR_PIN=16` to override default pin. You can also change the default off tim by adding `-D PIR_SENSOR_OFF_SEC=30`.
6427

6528
## API to enable/disable the PIR sensor from outside. For example from another usermod.
6629

@@ -121,4 +84,9 @@ Have fun - @gegu & @blazoncek
12184
12285
2021-11
12386
* Added information about dynamic configuration options
124-
* Added option to temporary enable/disble usermod from WLED UI (Info dialog)
87+
* Added option to temporary enable/disble usermod from WLED UI (Info dialog)
88+
89+
2022-11
90+
* Added compile time option for off timer.
91+
* Added Home Assistant autodiscovery MQTT broadcast.
92+
* Updated info on compiling.

0 commit comments

Comments
 (0)