@@ -102,30 +102,55 @@ def publish_json(
102102 no_prefix : bool = False ,
103103 * ,
104104 retain : bool = True ,
105+ qos : int = 0 ,
105106 ) -> None :
106107 raise NotImplementedError
107108
108109 @abstractmethod
109110 def publish_str (
110- self , key : str , value : str , no_prefix : bool = False , * , retain : bool = True
111+ self ,
112+ key : str ,
113+ value : str ,
114+ no_prefix : bool = False ,
115+ * ,
116+ retain : bool = True ,
117+ qos : int = 0 ,
111118 ) -> None :
112119 raise NotImplementedError
113120
114121 @abstractmethod
115122 def publish_int (
116- self , key : str , value : int , no_prefix : bool = False , * , retain : bool = True
123+ self ,
124+ key : str ,
125+ value : int ,
126+ no_prefix : bool = False ,
127+ * ,
128+ retain : bool = True ,
129+ qos : int = 0 ,
117130 ) -> None :
118131 raise NotImplementedError
119132
120133 @abstractmethod
121134 def publish_bool (
122- self , key : str , value : bool , no_prefix : bool = False , * , retain : bool = True
135+ self ,
136+ key : str ,
137+ value : bool ,
138+ no_prefix : bool = False ,
139+ * ,
140+ retain : bool = True ,
141+ qos : int = 0 ,
123142 ) -> None :
124143 raise NotImplementedError
125144
126145 @abstractmethod
127146 def publish_float (
128- self , key : str , value : float , no_prefix : bool = False , * , retain : bool = True
147+ self ,
148+ key : str ,
149+ value : float ,
150+ no_prefix : bool = False ,
151+ * ,
152+ retain : bool = True ,
153+ qos : int = 0 ,
129154 ) -> None :
130155 raise NotImplementedError
131156
@@ -173,7 +198,7 @@ def publish(
173198 raise TypeError (msg )
174199
175200 @abstractmethod
176- def clear_topic (self , key : str , no_prefix : bool = False ) -> None :
201+ def clear_topic (self , key : str , no_prefix : bool = False , qos : int = 0 ) -> None :
177202 raise NotImplementedError
178203
179204 def get_mqtt_account_prefix (self ) -> str :
@@ -249,7 +274,9 @@ def __anonymize(self, data: T) -> T:
249274 return data
250275
251276 def keepalive (self ) -> None :
252- self .publish_str (mqtt_topics .INTERNAL_LWT , "online" , False )
277+ self .publish_str (
278+ mqtt_topics .INTERNAL_LWT , "online" , no_prefix = False , retain = True , qos = 1
279+ )
253280
254281 @staticmethod
255282 def anonymize_str (value : str ) -> str :
0 commit comments