arthexis 0.1.8__py3-none-any.whl → 0.1.10__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 arthexis might be problematic. Click here for more details.
- {arthexis-0.1.8.dist-info → arthexis-0.1.10.dist-info}/METADATA +87 -6
- arthexis-0.1.10.dist-info/RECORD +95 -0
- arthexis-0.1.10.dist-info/licenses/LICENSE +674 -0
- config/__init__.py +0 -1
- config/auth_app.py +0 -1
- config/celery.py +1 -2
- config/context_processors.py +1 -1
- config/offline.py +2 -0
- config/settings.py +352 -37
- config/urls.py +71 -6
- core/admin.py +1601 -200
- core/admin_history.py +50 -0
- core/admindocs.py +108 -1
- core/apps.py +161 -3
- core/auto_upgrade.py +57 -0
- core/backends.py +123 -7
- core/entity.py +62 -48
- core/fields.py +98 -0
- core/github_helper.py +25 -0
- core/github_issues.py +172 -0
- core/lcd_screen.py +1 -0
- core/liveupdate.py +25 -0
- core/log_paths.py +100 -0
- core/mailer.py +83 -0
- core/middleware.py +57 -0
- core/models.py +1279 -267
- core/notifications.py +11 -1
- core/public_wifi.py +227 -0
- core/reference_utils.py +97 -0
- core/release.py +27 -20
- core/sigil_builder.py +144 -0
- core/sigil_context.py +20 -0
- core/sigil_resolver.py +284 -0
- core/system.py +162 -29
- core/tasks.py +269 -27
- core/test_system_info.py +59 -1
- core/tests.py +644 -73
- core/tests_liveupdate.py +17 -0
- core/urls.py +2 -2
- core/user_data.py +425 -168
- core/views.py +627 -59
- core/widgets.py +51 -0
- core/workgroup_urls.py +7 -3
- core/workgroup_views.py +43 -6
- nodes/actions.py +0 -2
- nodes/admin.py +168 -285
- nodes/apps.py +9 -15
- nodes/backends.py +145 -0
- nodes/lcd.py +24 -10
- nodes/models.py +579 -179
- nodes/tasks.py +1 -5
- nodes/tests.py +894 -130
- nodes/utils.py +13 -2
- nodes/views.py +204 -28
- ocpp/admin.py +212 -63
- ocpp/apps.py +1 -1
- ocpp/consumers.py +642 -68
- ocpp/evcs.py +30 -10
- ocpp/models.py +452 -70
- ocpp/simulator.py +75 -11
- ocpp/store.py +288 -30
- ocpp/tasks.py +11 -7
- ocpp/test_export_import.py +8 -7
- ocpp/test_rfid.py +211 -16
- ocpp/tests.py +1576 -137
- ocpp/transactions_io.py +68 -22
- ocpp/urls.py +35 -2
- ocpp/views.py +701 -123
- pages/admin.py +173 -13
- pages/checks.py +0 -1
- pages/context_processors.py +39 -6
- pages/forms.py +131 -0
- pages/middleware.py +153 -0
- pages/models.py +37 -9
- pages/tests.py +1182 -42
- pages/urls.py +4 -0
- pages/utils.py +0 -1
- pages/views.py +844 -51
- arthexis-0.1.8.dist-info/RECORD +0 -80
- arthexis-0.1.8.dist-info/licenses/LICENSE +0 -21
- config/workgroup_app.py +0 -7
- core/checks.py +0 -29
- {arthexis-0.1.8.dist-info → arthexis-0.1.10.dist-info}/WHEEL +0 -0
- {arthexis-0.1.8.dist-info → arthexis-0.1.10.dist-info}/top_level.txt +0 -0
ocpp/transactions_io.py
CHANGED
|
@@ -6,7 +6,7 @@ from typing import Iterable
|
|
|
6
6
|
from django.utils import timezone
|
|
7
7
|
from django.utils.dateparse import parse_datetime
|
|
8
8
|
|
|
9
|
-
from .models import Charger, Transaction,
|
|
9
|
+
from .models import Charger, Transaction, MeterValue
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
def export_transactions(
|
|
@@ -18,7 +18,7 @@ def export_transactions(
|
|
|
18
18
|
qs = (
|
|
19
19
|
Transaction.objects.all()
|
|
20
20
|
.select_related("charger")
|
|
21
|
-
.prefetch_related("
|
|
21
|
+
.prefetch_related("meter_values")
|
|
22
22
|
)
|
|
23
23
|
if start:
|
|
24
24
|
qs = qs.filter(start_time__gte=start)
|
|
@@ -32,11 +32,11 @@ def export_transactions(
|
|
|
32
32
|
|
|
33
33
|
for charger in Charger.objects.filter(charger_id__in=export_chargers):
|
|
34
34
|
data["chargers"].append(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
{
|
|
36
|
+
"charger_id": charger.charger_id,
|
|
37
|
+
"connector_id": charger.connector_id,
|
|
38
|
+
"require_rfid": charger.require_rfid,
|
|
39
|
+
}
|
|
40
40
|
)
|
|
41
41
|
|
|
42
42
|
for tx in qs:
|
|
@@ -48,17 +48,41 @@ def export_transactions(
|
|
|
48
48
|
"vin": tx.vin,
|
|
49
49
|
"meter_start": tx.meter_start,
|
|
50
50
|
"meter_stop": tx.meter_stop,
|
|
51
|
+
"voltage_start": tx.voltage_start,
|
|
52
|
+
"voltage_stop": tx.voltage_stop,
|
|
53
|
+
"current_import_start": tx.current_import_start,
|
|
54
|
+
"current_import_stop": tx.current_import_stop,
|
|
55
|
+
"current_offered_start": tx.current_offered_start,
|
|
56
|
+
"current_offered_stop": tx.current_offered_stop,
|
|
57
|
+
"temperature_start": tx.temperature_start,
|
|
58
|
+
"temperature_stop": tx.temperature_stop,
|
|
59
|
+
"soc_start": tx.soc_start,
|
|
60
|
+
"soc_stop": tx.soc_stop,
|
|
51
61
|
"start_time": tx.start_time.isoformat(),
|
|
52
62
|
"stop_time": tx.stop_time.isoformat() if tx.stop_time else None,
|
|
53
|
-
"
|
|
63
|
+
"meter_values": [
|
|
54
64
|
{
|
|
55
|
-
"connector_id":
|
|
56
|
-
"timestamp":
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
65
|
+
"connector_id": mv.connector_id,
|
|
66
|
+
"timestamp": mv.timestamp.isoformat(),
|
|
67
|
+
"context": mv.context,
|
|
68
|
+
"energy": str(mv.energy) if mv.energy is not None else None,
|
|
69
|
+
"voltage": str(mv.voltage) if mv.voltage is not None else None,
|
|
70
|
+
"current_import": (
|
|
71
|
+
str(mv.current_import)
|
|
72
|
+
if mv.current_import is not None
|
|
73
|
+
else None
|
|
74
|
+
),
|
|
75
|
+
"current_offered": (
|
|
76
|
+
str(mv.current_offered)
|
|
77
|
+
if mv.current_offered is not None
|
|
78
|
+
else None
|
|
79
|
+
),
|
|
80
|
+
"temperature": (
|
|
81
|
+
str(mv.temperature) if mv.temperature is not None else None
|
|
82
|
+
),
|
|
83
|
+
"soc": str(mv.soc) if mv.soc is not None else None,
|
|
60
84
|
}
|
|
61
|
-
for
|
|
85
|
+
for mv in tx.meter_values.all()
|
|
62
86
|
],
|
|
63
87
|
}
|
|
64
88
|
)
|
|
@@ -83,10 +107,15 @@ def import_transactions(data: dict) -> int:
|
|
|
83
107
|
"""
|
|
84
108
|
charger_map: dict[str, Charger] = {}
|
|
85
109
|
for item in data.get("chargers", []):
|
|
110
|
+
connector_value = item.get("connector_id", None)
|
|
111
|
+
if connector_value in ("", None):
|
|
112
|
+
connector_value = None
|
|
113
|
+
elif isinstance(connector_value, str):
|
|
114
|
+
connector_value = int(connector_value)
|
|
86
115
|
charger, _ = Charger.objects.get_or_create(
|
|
87
116
|
charger_id=item["charger_id"],
|
|
88
117
|
defaults={
|
|
89
|
-
"connector_id":
|
|
118
|
+
"connector_id": connector_value,
|
|
90
119
|
"require_rfid": item.get("require_rfid", False),
|
|
91
120
|
},
|
|
92
121
|
)
|
|
@@ -102,18 +131,35 @@ def import_transactions(data: dict) -> int:
|
|
|
102
131
|
vin=tx.get("vin", ""),
|
|
103
132
|
meter_start=tx.get("meter_start"),
|
|
104
133
|
meter_stop=tx.get("meter_stop"),
|
|
134
|
+
voltage_start=tx.get("voltage_start"),
|
|
135
|
+
voltage_stop=tx.get("voltage_stop"),
|
|
136
|
+
current_import_start=tx.get("current_import_start"),
|
|
137
|
+
current_import_stop=tx.get("current_import_stop"),
|
|
138
|
+
current_offered_start=tx.get("current_offered_start"),
|
|
139
|
+
current_offered_stop=tx.get("current_offered_stop"),
|
|
140
|
+
temperature_start=tx.get("temperature_start"),
|
|
141
|
+
temperature_stop=tx.get("temperature_stop"),
|
|
142
|
+
soc_start=tx.get("soc_start"),
|
|
143
|
+
soc_stop=tx.get("soc_stop"),
|
|
105
144
|
start_time=_parse_dt(tx.get("start_time")),
|
|
106
145
|
stop_time=_parse_dt(tx.get("stop_time")),
|
|
107
146
|
)
|
|
108
|
-
for
|
|
109
|
-
|
|
147
|
+
for mv in tx.get("meter_values", []):
|
|
148
|
+
connector_id = mv.get("connector_id")
|
|
149
|
+
if isinstance(connector_id, str):
|
|
150
|
+
connector_id = int(connector_id)
|
|
151
|
+
MeterValue.objects.create(
|
|
110
152
|
charger=charger,
|
|
111
153
|
transaction=transaction,
|
|
112
|
-
connector_id=
|
|
113
|
-
timestamp=_parse_dt(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
154
|
+
connector_id=connector_id,
|
|
155
|
+
timestamp=_parse_dt(mv.get("timestamp")),
|
|
156
|
+
context=mv.get("context", ""),
|
|
157
|
+
energy=mv.get("energy"),
|
|
158
|
+
voltage=mv.get("voltage"),
|
|
159
|
+
current_import=mv.get("current_import"),
|
|
160
|
+
current_offered=mv.get("current_offered"),
|
|
161
|
+
temperature=mv.get("temperature"),
|
|
162
|
+
soc=mv.get("soc"),
|
|
117
163
|
)
|
|
118
164
|
imported += 1
|
|
119
165
|
return imported
|
ocpp/urls.py
CHANGED
|
@@ -7,11 +7,44 @@ urlpatterns = [
|
|
|
7
7
|
path("simulator/", views.cp_simulator, name="cp-simulator"),
|
|
8
8
|
path("chargers/", views.charger_list, name="charger-list"),
|
|
9
9
|
path("chargers/<str:cid>/", views.charger_detail, name="charger-detail"),
|
|
10
|
+
path(
|
|
11
|
+
"chargers/<str:cid>/connector/<slug:connector>/",
|
|
12
|
+
views.charger_detail,
|
|
13
|
+
name="charger-detail-connector",
|
|
14
|
+
),
|
|
10
15
|
path("chargers/<str:cid>/action/", views.dispatch_action, name="charger-action"),
|
|
16
|
+
path(
|
|
17
|
+
"chargers/<str:cid>/connector/<slug:connector>/action/",
|
|
18
|
+
views.dispatch_action,
|
|
19
|
+
name="charger-action-connector",
|
|
20
|
+
),
|
|
11
21
|
path("c/<str:cid>/", views.charger_page, name="charger-page"),
|
|
12
|
-
path(
|
|
22
|
+
path(
|
|
23
|
+
"c/<str:cid>/connector/<slug:connector>/",
|
|
24
|
+
views.charger_page,
|
|
25
|
+
name="charger-page-connector",
|
|
26
|
+
),
|
|
27
|
+
path(
|
|
28
|
+
"c/<str:cid>/sessions/",
|
|
29
|
+
views.charger_session_search,
|
|
30
|
+
name="charger-session-search",
|
|
31
|
+
),
|
|
32
|
+
path(
|
|
33
|
+
"c/<str:cid>/connector/<slug:connector>/sessions/",
|
|
34
|
+
views.charger_session_search,
|
|
35
|
+
name="charger-session-search-connector",
|
|
36
|
+
),
|
|
13
37
|
path("log/<str:cid>/", views.charger_log_page, name="charger-log"),
|
|
38
|
+
path(
|
|
39
|
+
"log/<str:cid>/connector/<slug:connector>/",
|
|
40
|
+
views.charger_log_page,
|
|
41
|
+
name="charger-log-connector",
|
|
42
|
+
),
|
|
14
43
|
path("c/<str:cid>/status/", views.charger_status, name="charger-status"),
|
|
44
|
+
path(
|
|
45
|
+
"c/<str:cid>/connector/<slug:connector>/status/",
|
|
46
|
+
views.charger_status,
|
|
47
|
+
name="charger-status-connector",
|
|
48
|
+
),
|
|
15
49
|
path("rfid/", include("ocpp.rfid.urls")),
|
|
16
|
-
path("efficiency/", views.efficiency_calculator, name="ev-efficiency"),
|
|
17
50
|
]
|