Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Python-MQTT Library
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
Releases
Package registry
Container 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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WZL-IQS-Public
Internet of Things
Python-MQTT Library
Commits
3d325d90
Commit
3d325d90
authored
5 years ago
by
Matthias Bodenbenner
Browse files
Options
Downloads
Patches
Plain Diff
removed badly integrated publisher
parent
5dbcc318
No related branches found
No related tags found
No related merge requests found
Pipeline
#17735
passed
5 years ago
Stage: environment
Stage: deploy
Stage: restart
Stage: notify
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
dist/wzl_mqtt-1.2.0-py3-none-any.whl
+0
-0
0 additions, 0 deletions
dist/wzl_mqtt-1.2.0-py3-none-any.whl
setup.py
+1
-1
1 addition, 1 deletion
setup.py
wzl/mqtt/__init__.py
+0
-1
0 additions, 1 deletion
wzl/mqtt/__init__.py
wzl/mqtt/specialized.py
+0
-45
0 additions, 45 deletions
wzl/mqtt/specialized.py
with
1 addition
and
47 deletions
dist/wzl_mqtt-1.
1.3
-py3-none-any.whl
→
dist/wzl_mqtt-1.
2.0
-py3-none-any.whl
+
0
−
0
View file @
3d325d90
No preview for this file type
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
3d325d90
from
setuptools
import
setup
,
find_packages
setup
(
name
=
'
wzl-mqtt
'
,
version
=
'
1.
1.3
'
,
version
=
'
1.
2.0
'
,
url
=
''
,
author
=
'
Benjamin Montavon, Matthias Bodenbenner
'
,
author_email
=
'
m.bodenbenner@wzl.rwth-aachen.de
'
,
...
...
This diff is collapsed.
Click to expand it.
wzl/mqtt/__init__.py
+
0
−
1
View file @
3d325d90
...
...
@@ -11,4 +11,3 @@ from .exceptions import PublishError as PublishError
from
.client
import
MQTTPublisher
from
.client
import
MQTTReceiver
from
.specialized
import
ScheduledMQTTPublisher
This diff is collapsed.
Click to expand it.
wzl/mqtt/specialized.py
deleted
100644 → 0
+
0
−
45
View file @
5dbcc318
import
datetime
import
json
from
typing
import
Dict
from
.client
import
MQTTPublisher
class
ScheduledMQTTPublisher
(
MQTTPublisher
):
def
__init__
(
self
,
loop
,
duid
,
schedule
:
Dict
,
*
args
,
**
kwargs
):
MQTTPublisher
.
__init__
(
self
,
duid
,
*
args
,
**
kwargs
)
self
.
_loop
=
loop
self
.
_schedule
=
schedule
if
len
(
self
.
_schedule
.
keys
())
>
0
:
self
.
_update
()
def
_update
(
self
):
now
=
datetime
.
datetime
.
now
()
next
=
None
for
luid
in
self
.
_schedule
:
data
=
self
.
_schedule
[
luid
]
if
data
[
'
next
'
]
is
not
None
and
data
[
'
next
'
]
<=
now
:
try
:
value
=
data
[
'
method
'
]()
ret
=
{
'
uuid
'
:
luid
,
'
value
'
:
value
}
self
.
publish
(
luid
,
json
.
dumps
(
ret
),
1
)
except
Exception
as
e
:
pass
try
:
if
callable
(
data
[
'
interval
'
]):
data
[
'
next
'
]
=
now
+
datetime
.
timedelta
(
seconds
=
data
[
'
interval
'
]())
else
:
data
[
'
next
'
]
=
now
+
datetime
.
timedelta
(
seconds
=
data
[
'
interval
'
])
except
Exception
as
e
:
# if the next time for publishing can not be set, deactivate publising by setting 'next' to None
data
[
'
next
'
]
=
None
if
next
is
None
or
(
data
[
'
next
'
]
is
not
None
and
data
[
'
next
'
]
<
next
):
next
=
data
[
'
next
'
]
if
next
is
None
:
next
=
now
+
datetime
.
timedelta
(
seconds
=
10
)
self
.
_loop
.
call_later
((
next
-
now
).
seconds
+
(
next
-
now
).
microseconds
/
1e6
,
self
.
_update
)
\ No newline at end of file
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