Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit e96a485

Browse files
ilcatoaentinger
authored andcommitted
Implement @lxrobotics suggestions
1 parent b1691c3 commit e96a485

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ Makefile
1414

1515
.vscode
1616
.vs
17+
.DS_Store

src/types/automation/CloudTelevision.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/******************************************************************************
2929
ENUM
3030
******************************************************************************/
31-
enum class PlaybackCommands : u_int8_t {
31+
enum class PlaybackCommands : uint8_t {
3232
FastForward = 0,
3333
Next = 1,
3434
Pause = 2,
@@ -39,7 +39,7 @@ enum class PlaybackCommands : u_int8_t {
3939
Stop = 7,
4040
None = 255
4141
};
42-
enum class InputValue : u_int8_t {
42+
enum class InputValue : uint8_t {
4343
AUX1 = 0,
4444
AUX2 = 1,
4545
AUX3 = 2,
@@ -110,17 +110,17 @@ enum class InputValue : u_int8_t {
110110
class Television {
111111
public:
112112
bool swi;
113-
u_int8_t vol;
113+
uint8_t vol;
114114
bool mut;
115115
PlaybackCommands pbc;
116116
InputValue inp;
117-
u_int16_t cha;
117+
uint16_t cha;
118118

119119

120-
Television(bool swi, u_int8_t vol, bool mut, PlaybackCommands pbc, InputValue inp, u_int16_t cha): swi(swi), vol(vol), mut(mut), pbc(pbc), inp(inp), cha(cha) {
120+
Television(bool const swi, uint8_t const vol, bool const mut, PlaybackCommands const pbc, InputValue const inp, uint16_t const cha): swi(swi), vol(vol), mut(mut), pbc(pbc), inp(inp), cha(cha) {
121121
}
122122

123-
bool operator==(Television & aTV) {
123+
bool operator==(Television const & aTV) {
124124
return
125125
aTV.swi == swi &&
126126
aTV.vol == vol &&
@@ -130,7 +130,7 @@ class Television {
130130
aTV.cha == cha;
131131
}
132132

133-
bool operator!=(Television & aTV) {
133+
bool operator!=(Television const & aTV) {
134134
return !(operator==(aTV));
135135
}
136136

@@ -142,14 +142,14 @@ class CloudTelevision : public ArduinoCloudProperty {
142142
_cloud_value;
143143
public:
144144
CloudTelevision() : _value(false, 0, false, PlaybackCommands::None, InputValue::TV, 0), _cloud_value(false, 0, false, PlaybackCommands::None, InputValue::TV, 0) {}
145-
CloudTelevision(bool swi, u_int8_t vol, bool mut, PlaybackCommands pbc, InputValue inp, u_int16_t cha) : _value(swi, vol, mut, pbc, inp, cha), _cloud_value(swi, vol, mut, pbc, inp, cha) {}
145+
CloudTelevision(bool const swi, uint8_t const vol, bool const mut, PlaybackCommands const pbc, InputValue const inp, uint16_t const cha) : _value(swi, vol, mut, pbc, inp, cha), _cloud_value(swi, vol, mut, pbc, inp, cha) {}
146146

147147
virtual bool isDifferentFromCloud() {
148148

149149
return _value != _cloud_value;
150150
}
151151

152-
CloudTelevision& operator=(Television aTV) {
152+
CloudTelevision& operator=(Television const aTV) {
153153
_value.swi = aTV.swi;
154154
_value.vol = aTV.vol;
155155
_value.mut = aTV.mut;
@@ -172,7 +172,7 @@ class CloudTelevision : public ArduinoCloudProperty {
172172
return _value.swi;
173173
}
174174

175-
u_int8_t getVolume() {
175+
uint8_t getVolume() {
176176
return _value.vol;
177177
}
178178

@@ -188,7 +188,7 @@ class CloudTelevision : public ArduinoCloudProperty {
188188
return _value.inp;
189189
}
190190

191-
u_int16_t getChannel() {
191+
uint16_t getChannel() {
192192
return _value.cha;
193193
}
194194

0 commit comments

Comments
 (0)