wizata-dsapi 1.2.7__py3-none-any.whl → 1.2.8__py3-none-any.whl
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.
- wizata_dsapi/twin.py +14 -1
- wizata_dsapi/version.py +1 -1
- {wizata_dsapi-1.2.7.dist-info → wizata_dsapi-1.2.8.dist-info}/METADATA +1 -1
- {wizata_dsapi-1.2.7.dist-info → wizata_dsapi-1.2.8.dist-info}/RECORD +7 -7
- {wizata_dsapi-1.2.7.dist-info → wizata_dsapi-1.2.8.dist-info}/LICENSE.txt +0 -0
- {wizata_dsapi-1.2.7.dist-info → wizata_dsapi-1.2.8.dist-info}/WHEEL +0 -0
- {wizata_dsapi-1.2.7.dist-info → wizata_dsapi-1.2.8.dist-info}/top_level.txt +0 -0
wizata_dsapi/twin.py
CHANGED
|
@@ -2,6 +2,7 @@ import uuid
|
|
|
2
2
|
from .api_dto import ApiDto
|
|
3
3
|
from enum import Enum
|
|
4
4
|
import re
|
|
5
|
+
import json
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
def is_valid_hex_color(color):
|
|
@@ -149,7 +150,9 @@ class Twin(ApiDto):
|
|
|
149
150
|
def __init__(self, twin_id=None, hardware_id=None, name=None, parent_id=None, ttype=TwinBlockType.MACHINE,
|
|
150
151
|
type_id:uuid.UUID = None,
|
|
151
152
|
latitude_id: uuid.UUID = None, longitude_id: uuid.UUID = None, color: str = None, icon: str = None,
|
|
152
|
-
latitude: float = None, longitude: float = None,
|
|
153
|
+
latitude: float = None, longitude: float = None,
|
|
154
|
+
extra_properties: dict = None,
|
|
155
|
+
description: str = None):
|
|
153
156
|
if twin_id is None:
|
|
154
157
|
self.twin_id = uuid.uuid4()
|
|
155
158
|
else:
|
|
@@ -168,6 +171,7 @@ class Twin(ApiDto):
|
|
|
168
171
|
is_valid_hex_color(color)
|
|
169
172
|
self.color = color
|
|
170
173
|
self.icon = icon
|
|
174
|
+
self.extra_properties = extra_properties
|
|
171
175
|
self.createdById = None
|
|
172
176
|
self.createdDate = None
|
|
173
177
|
self.updatedById = None
|
|
@@ -207,6 +211,11 @@ class Twin(ApiDto):
|
|
|
207
211
|
self.description = str(obj["description"])
|
|
208
212
|
if "type" in obj.keys():
|
|
209
213
|
self.type = TwinBlockType(str(obj["type"]))
|
|
214
|
+
if "extraProperties" in obj.keys():
|
|
215
|
+
if isinstance(obj["extraProperties"], str):
|
|
216
|
+
self.extra_properties = json.loads(obj["extraProperties"])
|
|
217
|
+
else:
|
|
218
|
+
self.extra_properties = obj["extraProperties"]
|
|
210
219
|
if "createdById" in obj.keys() and obj["createdById"] is not None:
|
|
211
220
|
self.createdById = obj["createdById"]
|
|
212
221
|
if "createdDate" in obj.keys() and obj["createdDate"] is not None:
|
|
@@ -244,6 +253,10 @@ class Twin(ApiDto):
|
|
|
244
253
|
obj["longitudeSensorId"] = str(self.longitude_id)
|
|
245
254
|
if self.icon is not None:
|
|
246
255
|
obj["icon"] = str(self.icon)
|
|
256
|
+
if self.extra_properties is not None:
|
|
257
|
+
if not isinstance(self.extra_properties, dict):
|
|
258
|
+
raise ValueError('on twin extra properties must be None or a JSON serializable dict')
|
|
259
|
+
obj["extraProperties"] = json.dumps(self.extra_properties)
|
|
247
260
|
if self.createdById is not None:
|
|
248
261
|
obj["createdById"] = str(self.createdById)
|
|
249
262
|
if self.createdDate is not None:
|
wizata_dsapi/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.2.
|
|
1
|
+
__version__ = "1.2.8"
|
|
@@ -29,9 +29,9 @@ wizata_dsapi/solution_component.py,sha256=8gbZWx2h_xUqI_pAXa3goqAnR5Y-GDMii8MeGl
|
|
|
29
29
|
wizata_dsapi/streamlit_utils.py,sha256=sXBdygktbixV828Zg01Nl27_a4F8zGFc4RY0C8g-1bc,1942
|
|
30
30
|
wizata_dsapi/template.py,sha256=h2f3dLduJ4WhreVxJXuFIB3pinnI3c39WxBms0bCgos,13007
|
|
31
31
|
wizata_dsapi/trigger.py,sha256=w3BZYP-L3SUwvaT0oCTanh_Ewn57peZvlt7vxzHv9J8,5129
|
|
32
|
-
wizata_dsapi/twin.py,sha256=
|
|
32
|
+
wizata_dsapi/twin.py,sha256=_iYbbKw_m8flEzdnwGbA-NvSUiyQQDgCTa9vJeEggRg,10556
|
|
33
33
|
wizata_dsapi/twinregistration.py,sha256=Mi6-YuwroiEXc0c1hgrOaphh4hNVoHupxOnXedVtJtE,13377
|
|
34
|
-
wizata_dsapi/version.py,sha256=
|
|
34
|
+
wizata_dsapi/version.py,sha256=CfVXm0wwlKPW0khOcwhWw61TpgtZiLijCePsAIOK3aU,22
|
|
35
35
|
wizata_dsapi/wizard_function.py,sha256=RbM7W7Gf-6Rhp_1dU9DBYkHaciknGAGvuAndhAS_vyo,942
|
|
36
36
|
wizata_dsapi/wizard_request.py,sha256=v6BaqKLKvTWmUSo0_gda9FabAQz5x_-GOH1Av50GzFo,3762
|
|
37
37
|
wizata_dsapi/wizata_dsapi_client.py,sha256=Qz54vYoxRLBUa21Q55K5Oo1qtZpW9ucuXi4BX1N85oE,78716
|
|
@@ -42,8 +42,8 @@ wizata_dsapi/plots/__init__.py,sha256=qgnSFqrjOPur-807M8uh5awIfjM1ZHXUXcAqHc-r2l
|
|
|
42
42
|
wizata_dsapi/plots/common.py,sha256=jdPsJqLHBwSKc6dX83BSGPqSRxzIVNHSYO5yI_8sjGk,6568
|
|
43
43
|
wizata_dsapi/scripts/__init__.py,sha256=hAxiETSQf0qOHde1si1tEAJU48seqEgHrchCzS2-LvQ,80
|
|
44
44
|
wizata_dsapi/scripts/common.py,sha256=efwq-Rd0lvYljIs3gSFz9izogBD7asOU2cTK-IvHTkM,4244
|
|
45
|
-
wizata_dsapi-1.2.
|
|
46
|
-
wizata_dsapi-1.2.
|
|
47
|
-
wizata_dsapi-1.2.
|
|
48
|
-
wizata_dsapi-1.2.
|
|
49
|
-
wizata_dsapi-1.2.
|
|
45
|
+
wizata_dsapi-1.2.8.dist-info/LICENSE.txt,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
46
|
+
wizata_dsapi-1.2.8.dist-info/METADATA,sha256=WRikpYQRfPcBEkfk239lutdBmdl7ApxLsglLGMdmySk,2187
|
|
47
|
+
wizata_dsapi-1.2.8.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
48
|
+
wizata_dsapi-1.2.8.dist-info/top_level.txt,sha256=-OeTJbEnh5DuWyTOHtvw0Dw3LRg3G27TNS6W4ZtfwPs,13
|
|
49
|
+
wizata_dsapi-1.2.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|