layrz-sdk 3.1.2__py3-none-any.whl → 3.1.3__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.

Potentially problematic release.


This version of layrz-sdk might be problematic. Click here for more details.

Files changed (75) hide show
  1. layrz_sdk/__init__.py +1 -1
  2. layrz_sdk/constants.py +5 -5
  3. layrz_sdk/entities/__init__.py +129 -129
  4. layrz_sdk/entities/asset.py +69 -71
  5. layrz_sdk/entities/asset_operation_mode.py +31 -31
  6. layrz_sdk/entities/broadcast_request.py +12 -12
  7. layrz_sdk/entities/broadcast_response.py +12 -12
  8. layrz_sdk/entities/broadcast_result.py +20 -20
  9. layrz_sdk/entities/broadcast_status.py +28 -28
  10. layrz_sdk/entities/case.py +47 -47
  11. layrz_sdk/entities/case_ignored_status.py +26 -26
  12. layrz_sdk/entities/case_status.py +23 -23
  13. layrz_sdk/entities/charts/axis_config.py +15 -15
  14. layrz_sdk/entities/charts/bar_chart.py +171 -171
  15. layrz_sdk/entities/charts/chart_alignment.py +27 -27
  16. layrz_sdk/entities/charts/chart_color.py +44 -44
  17. layrz_sdk/entities/charts/chart_configuration.py +10 -10
  18. layrz_sdk/entities/charts/chart_data_serie.py +19 -19
  19. layrz_sdk/entities/charts/chart_data_serie_type.py +28 -28
  20. layrz_sdk/entities/charts/chart_data_type.py +27 -27
  21. layrz_sdk/entities/charts/chart_render_technology.py +30 -30
  22. layrz_sdk/entities/charts/column_chart.py +197 -197
  23. layrz_sdk/entities/charts/html_chart.py +34 -34
  24. layrz_sdk/entities/charts/line_chart.py +244 -244
  25. layrz_sdk/entities/charts/map_center_type.py +22 -22
  26. layrz_sdk/entities/charts/map_chart.py +104 -104
  27. layrz_sdk/entities/charts/map_point.py +22 -22
  28. layrz_sdk/entities/charts/number_chart.py +50 -50
  29. layrz_sdk/entities/charts/pie_chart.py +127 -127
  30. layrz_sdk/entities/charts/radar_chart.py +77 -77
  31. layrz_sdk/entities/charts/radial_bar_chart.py +127 -127
  32. layrz_sdk/entities/charts/scatter_chart.py +206 -206
  33. layrz_sdk/entities/charts/scatter_serie.py +15 -15
  34. layrz_sdk/entities/charts/scatter_serie_item.py +8 -8
  35. layrz_sdk/entities/charts/table_chart.py +50 -50
  36. layrz_sdk/entities/charts/table_header.py +8 -8
  37. layrz_sdk/entities/charts/table_row.py +9 -9
  38. layrz_sdk/entities/charts/timeline_chart.py +75 -75
  39. layrz_sdk/entities/charts/timeline_serie.py +12 -12
  40. layrz_sdk/entities/charts/timeline_serie_item.py +12 -12
  41. layrz_sdk/entities/checkpoint.py +18 -18
  42. layrz_sdk/entities/comment.py +16 -16
  43. layrz_sdk/entities/custom_field.py +10 -10
  44. layrz_sdk/entities/custom_report_page.py +16 -16
  45. layrz_sdk/entities/device.py +13 -13
  46. layrz_sdk/entities/event.py +23 -23
  47. layrz_sdk/entities/geofence.py +11 -11
  48. layrz_sdk/entities/last_message.py +12 -12
  49. layrz_sdk/entities/message.py +23 -23
  50. layrz_sdk/entities/outbound_service.py +10 -10
  51. layrz_sdk/entities/position.py +101 -101
  52. layrz_sdk/entities/presence_type.py +16 -16
  53. layrz_sdk/entities/report.py +257 -257
  54. layrz_sdk/entities/report_col.py +40 -40
  55. layrz_sdk/entities/report_configuration.py +8 -8
  56. layrz_sdk/entities/report_data_type.py +28 -28
  57. layrz_sdk/entities/report_format.py +27 -27
  58. layrz_sdk/entities/report_header.py +43 -43
  59. layrz_sdk/entities/report_page.py +17 -17
  60. layrz_sdk/entities/report_row.py +28 -28
  61. layrz_sdk/entities/sensor.py +11 -11
  62. layrz_sdk/entities/text_alignment.py +26 -26
  63. layrz_sdk/entities/trigger.py +11 -11
  64. layrz_sdk/entities/user.py +10 -10
  65. layrz_sdk/entities/waypoint.py +18 -18
  66. layrz_sdk/helpers/__init__.py +8 -8
  67. layrz_sdk/helpers/color.py +41 -41
  68. layrz_sdk/lcl/__init__.py +7 -7
  69. layrz_sdk/lcl/core.py +832 -832
  70. {layrz_sdk-3.1.2.dist-info → layrz_sdk-3.1.3.dist-info}/LICENSE +6 -6
  71. {layrz_sdk-3.1.2.dist-info → layrz_sdk-3.1.3.dist-info}/METADATA +48 -48
  72. layrz_sdk-3.1.3.dist-info/RECORD +75 -0
  73. {layrz_sdk-3.1.2.dist-info → layrz_sdk-3.1.3.dist-info}/WHEEL +1 -1
  74. layrz_sdk-3.1.2.dist-info/RECORD +0 -75
  75. {layrz_sdk-3.1.2.dist-info → layrz_sdk-3.1.3.dist-info}/top_level.txt +0 -0
@@ -1,77 +1,77 @@
1
- """Radar chart"""
2
-
3
- import sys
4
- from typing import Any, Dict, List
5
-
6
- from pydantic import BaseModel, Field
7
-
8
- from .chart_alignment import ChartAlignment
9
- from .chart_data_serie import ChartDataSerie
10
- from .chart_data_serie_type import ChartDataSerieType
11
-
12
- if sys.version_info >= (3, 11):
13
- from typing import Self
14
- else:
15
- from typing_extensions import Self
16
-
17
-
18
- class RadarChart(BaseModel):
19
- """Radar chart configuration"""
20
-
21
- x_axis: ChartDataSerie = Field(description='X Axis of the chart')
22
- y_axis: List[ChartDataSerie] = Field(description='Y Axis of the chart', default_factory=list)
23
- title: str = Field(description='Title of the chart', default='Chart')
24
- align: ChartAlignment = Field(description='Alignment of the chart', default=ChartAlignment.CENTER)
25
-
26
- def render(self: Self) -> Dict[str, Any]:
27
- """
28
- Render chart to a graphic Library.
29
- :param technology: The technology to use to render the chart.
30
- :return: The configuration of the chart.
31
- """
32
- return {'library': 'APEXCHARTS', 'configuration': self._render_apexcharts()}
33
-
34
- def _render_apexcharts(self: Self) -> Dict[str, Any]:
35
- """
36
- Converts the configuration of the chart to Javascript library ApexCharts.
37
- """
38
-
39
- series = []
40
- colors = []
41
-
42
- for serie in self.y_axis:
43
- modified_serie = {'name': serie.label, 'data': serie.data}
44
-
45
- if serie.serie_type is not ChartDataSerieType.NONE:
46
- modified_serie['type'] = serie.serie_type.value
47
-
48
- series.append(modified_serie)
49
- colors.append(serie.color)
50
-
51
- config = {
52
- 'series': series,
53
- 'colors': colors,
54
- 'xaxis': {
55
- 'categories': self.x_axis.data,
56
- 'type': self.x_axis.data_type.value,
57
- 'title': {
58
- 'text': self.x_axis.label,
59
- 'style': {'fontFamily': 'Fira Sans Condensed', 'fontSize': '20px', 'fontWeight': 'normal'},
60
- },
61
- },
62
- 'title': {
63
- 'text': self.title,
64
- 'align': self.align.value,
65
- 'style': {'fontFamily': 'Fira Sans Condensed', 'fontSize': '20px', 'fontWeight': 'normal'},
66
- },
67
- 'chart': {
68
- 'type': 'radar',
69
- 'animations': {'enabled': False},
70
- 'toolbar': {'show': False},
71
- 'zoom': {'enabled': False},
72
- },
73
- 'dataLabels': {'enabled': True},
74
- 'plotOptions': {'bar': {'horizontal': True, 'borderRadius': 4}},
75
- }
76
-
77
- return config
1
+ """Radar chart"""
2
+
3
+ import sys
4
+ from typing import Any, Dict, List
5
+
6
+ from pydantic import BaseModel, Field
7
+
8
+ from .chart_alignment import ChartAlignment
9
+ from .chart_data_serie import ChartDataSerie
10
+ from .chart_data_serie_type import ChartDataSerieType
11
+
12
+ if sys.version_info >= (3, 11):
13
+ from typing import Self
14
+ else:
15
+ from typing_extensions import Self
16
+
17
+
18
+ class RadarChart(BaseModel):
19
+ """Radar chart configuration"""
20
+
21
+ x_axis: ChartDataSerie = Field(description='X Axis of the chart')
22
+ y_axis: List[ChartDataSerie] = Field(description='Y Axis of the chart', default_factory=list)
23
+ title: str = Field(description='Title of the chart', default='Chart')
24
+ align: ChartAlignment = Field(description='Alignment of the chart', default=ChartAlignment.CENTER)
25
+
26
+ def render(self: Self) -> Dict[str, Any]:
27
+ """
28
+ Render chart to a graphic Library.
29
+ :param technology: The technology to use to render the chart.
30
+ :return: The configuration of the chart.
31
+ """
32
+ return {'library': 'APEXCHARTS', 'configuration': self._render_apexcharts()}
33
+
34
+ def _render_apexcharts(self: Self) -> Dict[str, Any]:
35
+ """
36
+ Converts the configuration of the chart to Javascript library ApexCharts.
37
+ """
38
+
39
+ series = []
40
+ colors = []
41
+
42
+ for serie in self.y_axis:
43
+ modified_serie = {'name': serie.label, 'data': serie.data}
44
+
45
+ if serie.serie_type is not ChartDataSerieType.NONE:
46
+ modified_serie['type'] = serie.serie_type.value
47
+
48
+ series.append(modified_serie)
49
+ colors.append(serie.color)
50
+
51
+ config = {
52
+ 'series': series,
53
+ 'colors': colors,
54
+ 'xaxis': {
55
+ 'categories': self.x_axis.data,
56
+ 'type': self.x_axis.data_type.value,
57
+ 'title': {
58
+ 'text': self.x_axis.label,
59
+ 'style': {'fontFamily': 'Fira Sans Condensed', 'fontSize': '20px', 'fontWeight': 'normal'},
60
+ },
61
+ },
62
+ 'title': {
63
+ 'text': self.title,
64
+ 'align': self.align.value,
65
+ 'style': {'fontFamily': 'Fira Sans Condensed', 'fontSize': '20px', 'fontWeight': 'normal'},
66
+ },
67
+ 'chart': {
68
+ 'type': 'radar',
69
+ 'animations': {'enabled': False},
70
+ 'toolbar': {'show': False},
71
+ 'zoom': {'enabled': False},
72
+ },
73
+ 'dataLabels': {'enabled': True},
74
+ 'plotOptions': {'bar': {'horizontal': True, 'borderRadius': 4}},
75
+ }
76
+
77
+ return config
@@ -1,127 +1,127 @@
1
- """Radial Bar chart"""
2
-
3
- import sys
4
- from typing import Any, Dict, List
5
-
6
- from pydantic import BaseModel, Field
7
-
8
- from .chart_alignment import ChartAlignment
9
- from .chart_data_serie import ChartDataSerie
10
- from .chart_render_technology import ChartRenderTechnology
11
-
12
- if sys.version_info >= (3, 11):
13
- from typing import Self
14
- else:
15
- from typing_extensions import Self
16
-
17
-
18
- class RadialBarChart(BaseModel):
19
- """Radial Bar chart configuration"""
20
-
21
- series: List[ChartDataSerie] = Field(description='List of series to be displayed in the chart', default_factory=list)
22
- title: str = Field(description='Title of the chart', default='Chart')
23
- align: ChartAlignment = Field(description='Alignment of the chart', default=ChartAlignment.CENTER)
24
-
25
- def render(
26
- self: Self,
27
- technology: ChartRenderTechnology = ChartRenderTechnology.SYNCFUSION_FLUTTER_CHARTS,
28
- ) -> Dict[str, Any]:
29
- """
30
- Render chart to a graphic Library.
31
- :param technology: The technology to use to render the chart.
32
- :return: The configuration of the chart.
33
- """
34
- if technology == ChartRenderTechnology.GRAPHIC:
35
- return {
36
- 'library': 'GRAPHIC',
37
- 'chart': 'RADIALBAR',
38
- 'configuration': self._render_graphic(),
39
- }
40
-
41
- if technology == ChartRenderTechnology.APEX_CHARTS:
42
- return {
43
- 'library': 'APEXCHARTS',
44
- 'chart': 'RADIALBAR',
45
- 'configuration': self._render_apexcharts(),
46
- }
47
-
48
- if technology == ChartRenderTechnology.SYNCFUSION_FLUTTER_CHARTS:
49
- return {
50
- 'library': 'SYNCFUSION_FLUTTER_CHARTS',
51
- 'chart': 'RADIALBAR',
52
- 'configuration': self._render_syncfusion_flutter_charts(),
53
- }
54
-
55
- return {
56
- 'library': 'FLUTTER',
57
- 'chart': 'TEXT',
58
- 'configuration': [f'Unsupported {technology}'],
59
- }
60
-
61
- def _render_syncfusion_flutter_charts(self) -> Any:
62
- """
63
- Converts the configuration of the chart to Syncfusion Flutter Charts.
64
- """
65
- series = []
66
-
67
- for serie in self.series:
68
- series.append(
69
- {
70
- 'label': serie.label,
71
- 'color': serie.color,
72
- 'value': serie.data[0],
73
- }
74
- )
75
-
76
- return {'series': series}
77
-
78
- def _render_graphic(self) -> Any:
79
- """
80
- Converts the configuration of the chart to a Flutter library Graphic.
81
- """
82
- series = []
83
-
84
- for serie in self.series:
85
- series.append(
86
- {
87
- 'group': serie.label,
88
- 'color': serie.color,
89
- 'value': serie.data[0],
90
- }
91
- )
92
-
93
- return series
94
-
95
- def _render_apexcharts(self) -> Any:
96
- """
97
- Converts the configuration of the chart to Javascript library ApexCharts.
98
- """
99
-
100
- series = []
101
- colors = []
102
- labels = []
103
-
104
- for serie in self.series:
105
- series.append(serie.data[0])
106
- colors.append(serie.color)
107
- labels.append(serie.label)
108
-
109
- config = {
110
- 'series': series,
111
- 'colors': colors,
112
- 'labels': labels,
113
- 'title': {
114
- 'text': self.title,
115
- 'align': self.align.value,
116
- 'style': {'fontFamily': 'Fira Sans Condensed', 'fontSize': '20px', 'fontWeight': 'normal'},
117
- },
118
- 'chart': {
119
- 'type': 'radialBar',
120
- 'animations': {'enabled': False},
121
- 'toolbar': {'show': False},
122
- 'zoom': {'enabled': False},
123
- },
124
- 'dataLabels': {'enabled': True},
125
- }
126
-
127
- return config
1
+ """Radial Bar chart"""
2
+
3
+ import sys
4
+ from typing import Any, Dict, List
5
+
6
+ from pydantic import BaseModel, Field
7
+
8
+ from .chart_alignment import ChartAlignment
9
+ from .chart_data_serie import ChartDataSerie
10
+ from .chart_render_technology import ChartRenderTechnology
11
+
12
+ if sys.version_info >= (3, 11):
13
+ from typing import Self
14
+ else:
15
+ from typing_extensions import Self
16
+
17
+
18
+ class RadialBarChart(BaseModel):
19
+ """Radial Bar chart configuration"""
20
+
21
+ series: List[ChartDataSerie] = Field(description='List of series to be displayed in the chart', default_factory=list)
22
+ title: str = Field(description='Title of the chart', default='Chart')
23
+ align: ChartAlignment = Field(description='Alignment of the chart', default=ChartAlignment.CENTER)
24
+
25
+ def render(
26
+ self: Self,
27
+ technology: ChartRenderTechnology = ChartRenderTechnology.SYNCFUSION_FLUTTER_CHARTS,
28
+ ) -> Dict[str, Any]:
29
+ """
30
+ Render chart to a graphic Library.
31
+ :param technology: The technology to use to render the chart.
32
+ :return: The configuration of the chart.
33
+ """
34
+ if technology == ChartRenderTechnology.GRAPHIC:
35
+ return {
36
+ 'library': 'GRAPHIC',
37
+ 'chart': 'RADIALBAR',
38
+ 'configuration': self._render_graphic(),
39
+ }
40
+
41
+ if technology == ChartRenderTechnology.APEX_CHARTS:
42
+ return {
43
+ 'library': 'APEXCHARTS',
44
+ 'chart': 'RADIALBAR',
45
+ 'configuration': self._render_apexcharts(),
46
+ }
47
+
48
+ if technology == ChartRenderTechnology.SYNCFUSION_FLUTTER_CHARTS:
49
+ return {
50
+ 'library': 'SYNCFUSION_FLUTTER_CHARTS',
51
+ 'chart': 'RADIALBAR',
52
+ 'configuration': self._render_syncfusion_flutter_charts(),
53
+ }
54
+
55
+ return {
56
+ 'library': 'FLUTTER',
57
+ 'chart': 'TEXT',
58
+ 'configuration': [f'Unsupported {technology}'],
59
+ }
60
+
61
+ def _render_syncfusion_flutter_charts(self) -> Any:
62
+ """
63
+ Converts the configuration of the chart to Syncfusion Flutter Charts.
64
+ """
65
+ series = []
66
+
67
+ for serie in self.series:
68
+ series.append(
69
+ {
70
+ 'label': serie.label,
71
+ 'color': serie.color,
72
+ 'value': serie.data[0],
73
+ }
74
+ )
75
+
76
+ return {'series': series}
77
+
78
+ def _render_graphic(self) -> Any:
79
+ """
80
+ Converts the configuration of the chart to a Flutter library Graphic.
81
+ """
82
+ series = []
83
+
84
+ for serie in self.series:
85
+ series.append(
86
+ {
87
+ 'group': serie.label,
88
+ 'color': serie.color,
89
+ 'value': serie.data[0],
90
+ }
91
+ )
92
+
93
+ return series
94
+
95
+ def _render_apexcharts(self) -> Any:
96
+ """
97
+ Converts the configuration of the chart to Javascript library ApexCharts.
98
+ """
99
+
100
+ series = []
101
+ colors = []
102
+ labels = []
103
+
104
+ for serie in self.series:
105
+ series.append(serie.data[0])
106
+ colors.append(serie.color)
107
+ labels.append(serie.label)
108
+
109
+ config = {
110
+ 'series': series,
111
+ 'colors': colors,
112
+ 'labels': labels,
113
+ 'title': {
114
+ 'text': self.title,
115
+ 'align': self.align.value,
116
+ 'style': {'fontFamily': 'Fira Sans Condensed', 'fontSize': '20px', 'fontWeight': 'normal'},
117
+ },
118
+ 'chart': {
119
+ 'type': 'radialBar',
120
+ 'animations': {'enabled': False},
121
+ 'toolbar': {'show': False},
122
+ 'zoom': {'enabled': False},
123
+ },
124
+ 'dataLabels': {'enabled': True},
125
+ }
126
+
127
+ return config