@@ -13,17 +13,17 @@ def test_chlorinator_status_decoding() -> None:
1313 # Bit 7: K2_ACTIVE (128)
1414 # Total: 2 + 4 + 128 = 134
1515 data = {
16- "system_id " : 5 ,
17- "status_raw " : 134 ,
18- "instant_salt_level " : 4082 ,
19- "avg_salt_level " : 4042 ,
20- "chlr_alert_raw " : 0 ,
21- "chlr_error_raw " : 0 ,
22- "sc_mode " : 0 ,
23- "operating_state " : 1 ,
24- "timed_percent " : 70 ,
25- "operating_mode " : 1 ,
26- "enable" : True ,
16+ "@systemId " : 5 ,
17+ "@status " : 134 ,
18+ "@instantSaltLevel " : 4082 ,
19+ "@avgSaltLevel " : 4042 ,
20+ "@chlrAlert " : 0 ,
21+ "@chlrError " : 0 ,
22+ "@scMode " : 0 ,
23+ "@operatingState " : 1 ,
24+ "@Timed-Percent " : 70 ,
25+ "@operatingMode " : 1 ,
26+ "@ enable" : True ,
2727 }
2828
2929 chlorinator = TelemetryChlorinator .model_validate (data )
@@ -47,16 +47,16 @@ def test_chlorinator_alert_decoding() -> None:
4747 # Create a chlorinator with chlrAlert = 32 (0b00100000)
4848 # Bit 5: CELL_TEMP_SCALEBACK (32)
4949 data = {
50- "system_id " : 5 ,
51- "status_raw " : 2 , # ALERT_PRESENT
52- "instant_salt_level " : 4082 ,
53- "avg_salt_level " : 4042 ,
54- "chlr_alert_raw " : 32 ,
55- "chlr_error_raw " : 0 ,
56- "sc_mode " : 0 ,
57- "operating_state " : 1 ,
58- "operating_mode " : 1 ,
59- "enable" : True ,
50+ "@systemId " : 5 ,
51+ "@status " : 2 , # ALERT_PRESENT
52+ "@instantSaltLevel " : 4082 ,
53+ "@avgSaltLevel " : 4042 ,
54+ "@chlrAlert " : 32 ,
55+ "@chlrError " : 0 ,
56+ "@scMode " : 0 ,
57+ "@operatingState " : 1 ,
58+ "@operatingMode " : 1 ,
59+ "@ enable" : True ,
6060 }
6161
6262 chlorinator = TelemetryChlorinator .model_validate (data )
@@ -77,16 +77,16 @@ def test_chlorinator_error_decoding() -> None:
7777 # Bit 8: K1_RELAY_SHORT (256)
7878 # Total: 1 + 256 = 257
7979 data = {
80- "system_id " : 5 ,
81- "status_raw " : 1 , # ERROR_PRESENT
82- "instant_salt_level " : 4082 ,
83- "avg_salt_level " : 4042 ,
84- "chlr_alert_raw " : 0 ,
85- "chlr_error_raw " : 257 ,
86- "sc_mode " : 0 ,
87- "operating_state " : 1 ,
88- "operating_mode " : 1 ,
89- "enable" : True ,
80+ "@systemId " : 5 ,
81+ "@status " : 1 , # ERROR_PRESENT
82+ "@instantSaltLevel " : 4082 ,
83+ "@avgSaltLevel " : 4042 ,
84+ "@chlrAlert " : 0 ,
85+ "@chlrError " : 257 ,
86+ "@scMode " : 0 ,
87+ "@operatingState " : 1 ,
88+ "@operatingMode " : 1 ,
89+ "@ enable" : True ,
9090 }
9191
9292 chlorinator = TelemetryChlorinator .model_validate (data )
@@ -104,16 +104,16 @@ def test_chlorinator_error_decoding() -> None:
104104def test_chlorinator_no_flags () -> None :
105105 """Test chlorinator with no status/alert/error flags set."""
106106 data = {
107- "system_id " : 5 ,
108- "status_raw " : 0 ,
109- "instant_salt_level " : 4082 ,
110- "avg_salt_level " : 4042 ,
111- "chlr_alert_raw " : 0 ,
112- "chlr_error_raw " : 0 ,
113- "sc_mode " : 0 ,
114- "operating_state " : 1 ,
115- "operating_mode " : 1 ,
116- "enable" : True ,
107+ "@systemId " : 5 ,
108+ "@status " : 0 ,
109+ "@instantSaltLevel " : 4082 ,
110+ "@avgSaltLevel " : 4042 ,
111+ "@chlrAlert " : 0 ,
112+ "@chlrError " : 0 ,
113+ "@scMode " : 0 ,
114+ "@operatingState " : 1 ,
115+ "@operatingMode " : 1 ,
116+ "@ enable" : True ,
117117 }
118118
119119 chlorinator = TelemetryChlorinator .model_validate (data )
@@ -133,16 +133,16 @@ def test_chlorinator_complex_alerts() -> None:
133133 # Bit 6: BOARD_TEMP_HIGH (64)
134134 # Total: 1 + 2 + 64 = 67
135135 data = {
136- "system_id " : 5 ,
137- "status_raw " : 2 ,
138- "instant_salt_level " : 4082 ,
139- "avg_salt_level " : 4042 ,
140- "chlr_alert_raw " : 67 ,
141- "chlr_error_raw " : 0 ,
142- "sc_mode " : 0 ,
143- "operating_state " : 1 ,
144- "operating_mode " : 1 ,
145- "enable" : True ,
136+ "@systemId " : 5 ,
137+ "@status " : 2 ,
138+ "@instantSaltLevel " : 4082 ,
139+ "@avgSaltLevel " : 4042 ,
140+ "@chlrAlert " : 67 ,
141+ "@chlrError " : 0 ,
142+ "@scMode " : 0 ,
143+ "@operatingState " : 1 ,
144+ "@operatingMode " : 1 ,
145+ "@ enable" : True ,
146146 }
147147
148148 chlorinator = TelemetryChlorinator .model_validate (data )
@@ -158,16 +158,16 @@ def test_chlorinator_all_status_flags() -> None:
158158 """Test chlorinator with all status flags set."""
159159 # status = 255 (0b11111111) - all 8 bits set
160160 data = {
161- "system_id " : 5 ,
162- "status_raw " : 255 ,
163- "instant_salt_level " : 4082 ,
164- "avg_salt_level " : 4042 ,
165- "chlr_alert_raw " : 0 ,
166- "chlr_error_raw " : 0 ,
167- "sc_mode " : 0 ,
168- "operating_state " : 1 ,
169- "operating_mode " : 1 ,
170- "enable" : True ,
161+ "@systemId " : 5 ,
162+ "@status " : 255 ,
163+ "@instantSaltLevel " : 4082 ,
164+ "@avgSaltLevel " : 4042 ,
165+ "@chlrAlert " : 0 ,
166+ "@chlrError " : 0 ,
167+ "@scMode " : 0 ,
168+ "@operatingState " : 1 ,
169+ "@operatingMode " : 1 ,
170+ "@ enable" : True ,
171171 }
172172
173173 chlorinator = TelemetryChlorinator .model_validate (data )
0 commit comments