@@ -60,7 +60,7 @@ class NodeAddRequest(NodeRequest):
6060
6161 def __init__ (self , mac , accept : bool ):
6262 super ().__init__ (mac )
63- accept_value = 1 if accept is True else 0
63+ accept_value = 1 if accept else 0
6464 self .args .append (Int (accept_value , length = 2 ))
6565
6666 # This message has an exceptional format (MAC at end of message)
@@ -85,7 +85,7 @@ class NodeAllowJoiningRequest(NodeRequest):
8585 def __init__ (self , accept : bool ):
8686 super ().__init__ ("" )
8787 # TODO: Make sure that '01' means enable, and '00' disable joining
88- val = 1 if accept is True else 0
88+ val = 1 if accept else 0
8989 self .args .append (Int (val , length = 2 ))
9090
9191
@@ -183,7 +183,7 @@ class CircleSwitchRelayRequest(NodeRequest):
183183
184184 def __init__ (self , mac , on ):
185185 super ().__init__ (mac )
186- val = 1 if on is True else 0
186+ val = 1 if on else 0
187187 self .args .append (Int (val , length = 2 ))
188188
189189
@@ -286,7 +286,7 @@ class CircleEnableScheduleRequest(NodeRequest):
286286
287287 def __init__ (self , mac , on ):
288288 super ().__init__ (mac )
289- val = 1 if on is True else 0
289+ val = 1 if on else 0
290290 self .args .append (Int (val , length = 2 ))
291291 # the second parameter is always 0x01
292292 self .args .append (Int (1 , length = 2 ))
@@ -335,7 +335,7 @@ class NodeBroadcastGroupSwitchRequest(NodeRequest):
335335
336336 def __init__ (self , group_mac , switch_state : bool ):
337337 super ().__init__ (group_mac )
338- val = 1 if switch_state is True else 0
338+ val = 1 if switch_state else 0
339339 self .args .append (Int (val , length = 2 ))
340340
341341
@@ -382,7 +382,7 @@ def __init__(
382382 stay_active_val = Int (stay_active , length = 2 )
383383 sleep_for_val = Int (sleep_for , length = 4 )
384384 maintenance_interval_val = Int (maintenance_interval , length = 4 )
385- val = 1 if sync_clock is True else 0
385+ val = 1 if sync_clock else 0
386386 clock_sync_val = Int (val , length = 2 )
387387 clock_interval_val = Int (clock_interval , length = 4 )
388388 self .args += [
@@ -479,7 +479,7 @@ def __init__(self, mac, reset_timer: int, sensitivity: int, light: bool):
479479 reset_timer_value = Int (reset_timer , length = 2 )
480480 # Sensitivity: HIGH(0x14), MEDIUM(0x1E), OFF(0xFF)
481481 sensitivity_value = Int (sensitivity , length = 2 )
482- light_temp = 1 if light is True else 0
482+ light_temp = 1 if light else 0
483483 light_value = Int (light_temp , length = 2 )
484484 self .args += [
485485 sensitivity_value ,
@@ -524,6 +524,6 @@ class CircleInitialRelaisStateRequest(NodeRequest):
524524
525525 def __init__ (self , mac , configure : bool , relais_state : bool ):
526526 super ().__init__ (mac )
527- set_or_get = Int (1 if configure is True else 0 , length = 2 )
528- relais = Int (1 if relais_state is True else 0 , length = 2 )
527+ set_or_get = Int (1 if configure else 0 , length = 2 )
528+ relais = Int (1 if relais_state else 0 , length = 2 )
529529 self .args += [set_or_get , relais ]
0 commit comments