Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nanospace-python-client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nanostar
nanospace
nanospace-clients
nanospace-python-client
Commits
7beb5d25
Commit
7beb5d25
authored
Jul 16, 2019
by
lucien senaneuch
Committed by
GATEAU Thibault
Dec 19, 2022
Browse files
Options
Downloads
Patches
Plain Diff
[eventBus] add bus message
parent
c34e6606
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
event_example.py
+22
-0
22 additions, 0 deletions
event_example.py
simple_example.py
+3
-4
3 additions, 4 deletions
simple_example.py
with
25 additions
and
4 deletions
event_example.py
0 → 100644
+
22
−
0
View file @
7beb5d25
import
paho.mqtt.client
as
mqtt
client
=
mqtt
.
Client
()
def
on_connect
(
client
,
userdata
,
flags
,
rc
):
print
(
"
Connected with result code
"
+
str
(
rc
))
# Subscribing in on_connect() means that if we lose the connection and
# reconnect then subscriptions will be renewed.
client
.
subscribe
(
"
#
"
)
# The callback for when a PUBLISH message is received from the server.
def
on_message
(
client
,
userdata
,
msg
):
print
(
msg
.
topic
+
"
"
+
str
(
msg
.
payload
))
client
=
mqtt
.
Client
()
client
.
on_connect
=
on_connect
client
.
on_message
=
on_message
client
.
connect
(
"
localhost
"
,
1884
,
60
)
client
.
loop_forever
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
simple_example.py
+
3
−
4
View file @
7beb5d25
from
nanospace
import
Nanospace
usr
=
'
usr
Name
'
usr
=
'
usr
'
pw
=
'
usrPw
'
srvAddr
=
'
http://
yourSrv.fr
/
'
srvAddr
=
'
http://
localhost:8888
/
'
nanospace
=
Nanospace
(
srvAddr
,
usr
,
pw
)
print
(
nanospace
.
get_string_value
(
83
))
nanospace
.
update__string_value
(
83
,
'
test
'
,
'
1Kg5
'
)
print
(
nanospace
.
get_formula_value
(
84
))
print
(
nanospace
.
update__formula_value
(
84
,
'
multiplication
'
,
'
5*20
'
))
\ No newline at end of file
nanospace
.
update__formula_value
(
84
,
'
multiplication
'
,
'
5*20
'
)
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