Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pissirSmartHome
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alfredo Chissotti
pissirSmartHome
Commits
2556aeb1
Commit
2556aeb1
authored
2 years ago
by
alfredo
Browse files
Options
Downloads
Patches
Plain Diff
unsub & sub
parent
5c6c25b1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scenariMicroservizio/src/scenari/Scenari.java
+6
-0
6 additions, 0 deletions
scenariMicroservizio/src/scenari/Scenari.java
with
6 additions
and
0 deletions
scenariMicroservizio/src/scenari/Scenari.java
+
6
−
0
View file @
2556aeb1
...
...
@@ -175,6 +175,8 @@ public class Scenari {
JSONObject
config
=
new
JSONObject
(
Helper
.
leggiFile
(
FILE_ZONA
));
config
.
put
(
"attiva-scenari"
,
attivaScenari
);
Helper
.
scriviFile
(
config
,
FILE_ZONA
);
mqttClient
.
unsubscribeTopic
(
Scenari
.
getMqttTree
(
"from/"
,
"/gpio/"
+
this
.
attivaScenari
);
mqttClient
.
subscribe
(
Scenari
.
getMqttTree
(
"from/"
,
"gpio/"
+
attivaScenari
);
this
.
attivaScenari
=
attivaScenari
;
}
...
...
@@ -189,6 +191,8 @@ public class Scenari {
JSONObject
config
=
new
JSONObject
(
Helper
.
leggiFile
(
FILE_ZONA
));
config
.
put
(
"luce-antifurto"
,
luceAntifurto
);
Helper
.
scriviFile
(
config
,
FILE_ZONA
);
mqttClient
.
unsubscribeTopic
(
Scenari
.
getMqttTree
(
"from/"
,
"/gpio/"
+
this
.
luceAntifurto
);
mqttClient
.
subscribe
(
Scenari
.
getMqttTree
(
"from/"
,
"gpio/"
+
luceAntifurto
);
this
.
luceAntifurto
=
luceAntifurto
;
}
...
...
@@ -199,6 +203,8 @@ public class Scenari {
JSONObject
config
=
new
JSONObject
(
Helper
.
leggiFile
(
FILE_ZONA
));
config
.
put
(
"learn-trigger"
,
learnTrigger
);
Helper
.
scriviFile
(
config
,
FILE_ZONA
);
mqttClient
.
unsubscribeTopic
(
Scenari
.
getMqttTree
(
"from/"
,
"/gpio/"
+
this
.
learnTrigger
);
mqttClient
.
subscribe
(
Scenari
.
getMqttTree
(
"from/"
,
"gpio/"
+
learnTrigger
);
this
.
learnTrigger
=
learnTrigger
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment