SpaIot Library
Loading...
Searching...
No Matches
controlpanel.h
1/*
2 * SpaIot Library (c) by epsilonrt - epsilonrt@epsilonrt.fr
3 * This file is part of SpaIot library <https://github.com/epsilonrt/spaiot-lib>
4 *
5 * SpaIot library is licensed under a
6 * Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
7 *
8 * You should have received a copy of the license along with this
9 * work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
10 *
11 * SpaIot library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY;
13 */
14#pragma once
15
16#include "hardwaresettings.h"
17#include "framedecoder.h"
18#include "button.h"
19
20namespace SpaIot {
21
29 class ControlPanel : public FrameDecoder {
30 public:
37
43 ControlPanel (const HardwareSettings & hwsettings);
44
51 ControlPanel (const String & hwSettingsName);
52
58 virtual void begin (unsigned long waitingTimeMs = BeginWaitingTimeMs);
59
66 virtual void begin (const HardwareSettings & hwsettings, unsigned long waitingTimeMs = BeginWaitingTimeMs);
67
74 virtual void begin (const String & hwSettingsName, unsigned long waitingTimeMs = BeginWaitingTimeMs);
75
82 virtual bool isOpen() const;
83
89 bool hasButton (int key) const;
90
96 Button & button (int key);
97
103 bool pushButton (int key);
104
110 uint8_t setPower (bool v = true);
111
117 uint8_t setFilter (bool v = true);
118
124 uint8_t setHeater (bool v = true);
125
131 uint8_t setBubble (bool v = true);
132
138 uint8_t setJet (bool v = true);
139
145 bool setDesiredTemp (uint16_t temp);
146
153 bool setSanitizerTime (uint16_t time);
154
161 uint16_t waitForDesiredTemp (unsigned long MaxWaitingTimeMs = 5000);
162
166 void end();
167
173 const std::map <int, ButtonSettings> buttonSettings() const;
174
175 protected:
176 class Private;
177 ControlPanel (Private &dd);
178 private:
179 PIMPL_DECLARE_PRIVATE (ControlPanel)
180 };
181
182}
This class represents a button.
Definition button.h:26
Control Panel.
Definition controlpanel.h:29
bool hasButton(int key) const
Check if the hardware configuration has the button.
uint8_t setJet(bool v=true)
Start or stop the water jets.
uint8_t setBubble(bool v=true)
Start or stop the the bubble generator.
bool pushButton(int key)
Press and release a button.
ControlPanel(const String &hwSettingsName)
Construct a new Control Panel object.
virtual void begin(const HardwareSettings &hwsettings, unsigned long waitingTimeMs=BeginWaitingTimeMs)
Configures each of the buttons and initializes and connect with the spa.
virtual bool isOpen() const
Indicates whether the connection with the spa is established.
bool setDesiredTemp(uint16_t temp)
Setting the desired water temperature.
uint16_t waitForDesiredTemp(unsigned long MaxWaitingTimeMs=5000)
Press the TempUp button to read the desired temperature.
uint8_t setPower(bool v=true)
Start or stop the spa.
ControlPanel()
Default constructor.
Button & button(int key)
Button.
void end()
Close the FrameDecoder.
uint8_t setFilter(bool v=true)
Start or stop the water filtration.
virtual void begin(const String &hwSettingsName, unsigned long waitingTimeMs=BeginWaitingTimeMs)
Configures each of the buttons and initializes and connect with the spa.
const std::map< int, ButtonSettings > buttonSettings() const
Button settings provides.
uint8_t setHeater(bool v=true)
Start or stop water heating.
bool setSanitizerTime(uint16_t time)
Set the water sanitation time.
ControlPanel(const HardwareSettings &hwsettings)
Construct a new Control Panel object.
virtual void begin(unsigned long waitingTimeMs=BeginWaitingTimeMs)
Configures each of the buttons and initializes and connect with the spa.
This class decodes information from the technical block of the spa.
Definition framedecoder.h:30
This class represents the hardware settings of a SpaIot device.
Definition hardwaresettings.h:25
SpaIot name space.
Definition bussettings.h:15
const unsigned long BeginWaitingTimeMs
begin() waiting time in milliseconds
Definition global.h:85