File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -107,15 +107,17 @@ extension MqttFormExtension on AugmentedForm {
107107
108108 /// Gets the MQTT topic for subscribing from this [Form] .
109109 ///
110- /// Throws an [Exception] if no topic could be retrieved.
110+ /// If present, this getter uses the dedicated vocabulary term `filter` .
111+ /// Otherwise, the URI query from the `href` field is being used as a
112+ /// fallback.
111113 String get topicFilter {
112114 final topic = _obtainVocabularyTerm <String >("filter" );
113115
114- if (topic = = null ) {
115- throw MqttBindingException ( "MQTT topic was not defined on form." ) ;
116+ if (topic ! = null ) {
117+ return topic;
116118 }
117119
118- return topic ;
120+ return Uri . decodeComponent (href.query. replaceAll ( "&" , "/" )) ;
119121 }
120122
121123 /// Gets the MQTT `retain` value from this [Form] if present.
You can’t perform that action at this time.
0 commit comments