ironflock 1.0.6__tar.gz → 1.0.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ironflock-1.0.6/ironflock.egg-info → ironflock-1.0.7}/PKG-INFO +1 -1
- {ironflock-1.0.6 → ironflock-1.0.7}/ironflock/__init__.py +1 -1
- {ironflock-1.0.6 → ironflock-1.0.7}/ironflock/ironflock.py +27 -2
- {ironflock-1.0.6 → ironflock-1.0.7/ironflock.egg-info}/PKG-INFO +1 -1
- {ironflock-1.0.6 → ironflock-1.0.7}/setup.py +1 -1
- {ironflock-1.0.6 → ironflock-1.0.7}/LICENSE +0 -0
- {ironflock-1.0.6 → ironflock-1.0.7}/MANIFEST.in +0 -0
- {ironflock-1.0.6 → ironflock-1.0.7}/README.md +0 -0
- {ironflock-1.0.6 → ironflock-1.0.7}/ironflock/AutobahnConnection.py +0 -0
- {ironflock-1.0.6 → ironflock-1.0.7}/ironflock.egg-info/SOURCES.txt +0 -0
- {ironflock-1.0.6 → ironflock-1.0.7}/ironflock.egg-info/dependency_links.txt +0 -0
- {ironflock-1.0.6 → ironflock-1.0.7}/ironflock.egg-info/requires.txt +0 -0
- {ironflock-1.0.6 → ironflock-1.0.7}/ironflock.egg-info/top_level.txt +0 -0
- {ironflock-1.0.6 → ironflock-1.0.7}/pyproject.toml +0 -0
- {ironflock-1.0.6 → ironflock-1.0.7}/requirements.txt +0 -0
- {ironflock-1.0.6 → ironflock-1.0.7}/setup.cfg +0 -0
|
@@ -136,13 +136,38 @@ class IronFlock:
|
|
|
136
136
|
app_key = os.environ.get("APP_KEY")
|
|
137
137
|
env_value = os.environ.get("ENV")
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
full_topic = f"{swarm_key}.{self._device_key}.{app_key}.{env_value}.{topic}"
|
|
140
140
|
|
|
141
141
|
if self._session is not None:
|
|
142
|
-
await self._session.register(
|
|
142
|
+
await self._session.register(func, full_topic, options=RegisterOptions(force_reregister=True))
|
|
143
143
|
else:
|
|
144
144
|
print("cannot register function, not connected")
|
|
145
145
|
|
|
146
|
+
async def call(self, device_key, topic, args, kwargs):
|
|
147
|
+
"""Calls a remote procedure on the IronFlock platform.
|
|
148
|
+
|
|
149
|
+
Args:
|
|
150
|
+
device_key (str): The key of the device to call the procedure on.
|
|
151
|
+
topic (str): The URI of the topic to call, e.g. "com.myprocedure".
|
|
152
|
+
args (list): The arguments to pass to the procedure.
|
|
153
|
+
kwargs (dict): The keyword arguments to pass to the procedure.
|
|
154
|
+
|
|
155
|
+
Returns:
|
|
156
|
+
The result of the remote procedure call.
|
|
157
|
+
"""
|
|
158
|
+
|
|
159
|
+
swarm_key = os.environ.get("SWARM_KEY")
|
|
160
|
+
app_key = os.environ.get("APP_KEY")
|
|
161
|
+
env_value = os.environ.get("ENV")
|
|
162
|
+
|
|
163
|
+
full_topic = f"{swarm_key}.{device_key}.{app_key}.{env_value}.{topic}"
|
|
164
|
+
|
|
165
|
+
if self._session is not None:
|
|
166
|
+
return await self._session.call(full_topic, *args, **kwargs)
|
|
167
|
+
else:
|
|
168
|
+
print("cannot call, not connected")
|
|
169
|
+
return None
|
|
170
|
+
|
|
146
171
|
async def publish_to_table(
|
|
147
172
|
self, tablename: str, *args, **kwargs
|
|
148
173
|
) -> Optional[Publication]:
|
|
@@ -10,7 +10,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
10
10
|
|
|
11
11
|
setup(
|
|
12
12
|
name="ironflock",
|
|
13
|
-
version="1.0.
|
|
13
|
+
version="1.0.7",
|
|
14
14
|
description="SDK to integrate your IronFlock Industry 4 Apps with the IronFlock Data Infrastructure",
|
|
15
15
|
long_description=long_description,
|
|
16
16
|
long_description_content_type="text/markdown",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|