File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
robot-server/robot_server/service/notifications Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 18
18
_TOPIC_BASE = TopicName ("robot-server" )
19
19
20
20
21
- def _is_valid_topic_name_segment ( segment : str ) -> bool :
22
- """Return whether a string is valid as a segment in an MQTT topic name."""
23
- return not re .match ("[/#+]" , segment )
21
+ def _is_valid_topic_name_level ( level : str ) -> bool :
22
+ """Return whether a string is valid as a level ( segment) in an MQTT topic name."""
23
+ return not re .match ("[/#+]" , level )
24
24
25
25
26
26
MAINTENANCE_RUNS_CURRENT_RUN = TopicName (f"{ _TOPIC_BASE } /maintenance_runs/current_run" )
@@ -35,7 +35,7 @@ def _is_valid_topic_name_segment(segment: str) -> bool:
35
35
def client_data (key : str ) -> TopicName :
36
36
"""Return the dynamic MQTT topic name for the given clientData key."""
37
37
base = f"{ _TOPIC_BASE } /clientData"
38
- if _is_valid_topic_name_segment (key ):
38
+ if _is_valid_topic_name_level (key ):
39
39
return TopicName (f"{ base } /{ key } " )
40
40
else :
41
41
raise ValueError (
You can’t perform that action at this time.
0 commit comments