File tree Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Original file line number Diff line number Diff line change
1
+ //
2
+ // Adafruit invests time and resources providing this open source code.
3
+ // Please support Adafruit and open source hardware by purchasing
4
+ // products from Adafruit!
5
+ //
6
+ // Copyright (c) 2015-2016 Adafruit Industries
7
+ // Authors: Tony DiCola, Todd Treece
8
+ // Licensed under the MIT license.
9
+ //
10
+ // All text above must be included in any redistribution.
11
+ //
12
+ #include " ToggleBlock.h"
13
+
14
+ ToggleBlock::ToggleBlock (AdafruitIO_Dashboard *d, AdafruitIO_Feed *f) : AdafruitIO_Block(d, f)
15
+ {
16
+ onText = 0 ;
17
+ offText = 0 ;
18
+ }
19
+
20
+ ToggleBlock::~ToggleBlock (){}
21
+
22
+ String ToggleBlock::properties ()
23
+ {
24
+ String props = " {\" onText\" :\" " ;
25
+ props += onText;
26
+ props += " \" ,\" offText\" :\" " ;
27
+ props += offText;
28
+ props += " \" }" ;
29
+
30
+ return props;
31
+ }
Original file line number Diff line number Diff line change
1
+ //
2
+ // Adafruit invests time and resources providing this open source code.
3
+ // Please support Adafruit and open source hardware by purchasing
4
+ // products from Adafruit!
5
+ //
6
+ // Copyright (c) 2015-2016 Adafruit Industries
7
+ // Authors: Tony DiCola, Todd Treece
8
+ // Licensed under the MIT license.
9
+ //
10
+ // All text above must be included in any redistribution.
11
+ //
12
+ #ifndef ADAFRUITIO_TOGGLEBLOCK_H
13
+ #define ADAFRUITIO_TOGGLEBLOCK_H
14
+
15
+ #include " AdafruitIO_Block.h"
16
+
17
+ class ToggleBlock : public AdafruitIO_Block {
18
+
19
+ public:
20
+ ToggleBlock (AdafruitIO_Dashboard *d, AdafruitIO_Feed *f);
21
+ ~ToggleBlock ();
22
+
23
+ const char *onText;
24
+ const char *offText;
25
+
26
+ String properties ();
27
+
28
+ private:
29
+ const char *_visual_type = " toggle_button" ;
30
+
31
+ };
32
+
33
+ #endif // ADAFRUITIO_TOGGLEBLOCK_H
You can’t perform that action at this time.
0 commit comments