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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ironflock
3
- Version: 1.0.6
3
+ Version: 1.0.7
4
4
  Summary: SDK to integrate your IronFlock Industry 4 Apps with the IronFlock Data Infrastructure
5
5
  Home-page: https://github.com/RecordEvolution/ironflock-py
6
6
  Author: Record Evolution GmbH
@@ -7,4 +7,4 @@ from ironflock.ironflock import IronFlock
7
7
 
8
8
  __all__ = ["IronFlock", "create_application_component", "create_application_session"]
9
9
 
10
- __version__ = "1.0.6"
10
+ __version__ = "1.0.7"
@@ -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
- topic = f"{swarm_key}.{self._device_key}.{app_key}.{env_value}.{topic}"
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(topic, func, options=RegisterOptions(force_reregister=True))
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]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ironflock
3
- Version: 1.0.6
3
+ Version: 1.0.7
4
4
  Summary: SDK to integrate your IronFlock Industry 4 Apps with the IronFlock Data Infrastructure
5
5
  Home-page: https://github.com/RecordEvolution/ironflock-py
6
6
  Author: Record Evolution GmbH
@@ -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.6",
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