simo 2.5.24__py3-none-any.whl → 2.5.25__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 simo might be problematic. Click here for more details.
- simo/fleet/__pycache__/admin.cpython-38.pyc +0 -0
- simo/fleet/__pycache__/managers.cpython-38.pyc +0 -0
- simo/fleet/__pycache__/socket_consumers.cpython-38.pyc +0 -0
- simo/fleet/admin.py +7 -4
- simo/fleet/managers.py +3 -3
- simo/fleet/socket_consumers.py +5 -0
- {simo-2.5.24.dist-info → simo-2.5.25.dist-info}/METADATA +1 -1
- {simo-2.5.24.dist-info → simo-2.5.25.dist-info}/RECORD +12 -12
- {simo-2.5.24.dist-info → simo-2.5.25.dist-info}/LICENSE.md +0 -0
- {simo-2.5.24.dist-info → simo-2.5.25.dist-info}/WHEEL +0 -0
- {simo-2.5.24.dist-info → simo-2.5.25.dist-info}/entry_points.txt +0 -0
- {simo-2.5.24.dist-info → simo-2.5.25.dist-info}/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
simo/fleet/admin.py
CHANGED
|
@@ -3,7 +3,7 @@ from django.contrib import admin
|
|
|
3
3
|
from django.utils.safestring import mark_safe
|
|
4
4
|
from django.template.loader import render_to_string
|
|
5
5
|
from django.templatetags.static import static
|
|
6
|
-
from simo.core.
|
|
6
|
+
from simo.core.middleware import get_current_instance
|
|
7
7
|
from simo.core.utils.admin import FormAction
|
|
8
8
|
from .models import Colonel, Interface, ColonelPin
|
|
9
9
|
from .forms import ColonelAdminForm, MoveColonelForm, InterfaceAdminForm
|
|
@@ -75,9 +75,7 @@ class ColonelAdmin(admin.ModelAdmin):
|
|
|
75
75
|
|
|
76
76
|
def get_queryset(self, request):
|
|
77
77
|
qs = super().get_queryset(request)
|
|
78
|
-
|
|
79
|
-
return qs
|
|
80
|
-
return qs.filter(instance__in=request.user.instances)
|
|
78
|
+
return qs.filter(instance=get_current_instance())
|
|
81
79
|
|
|
82
80
|
def save_model(self, request, obj, form, change):
|
|
83
81
|
super().save_model(request, obj, form, change)
|
|
@@ -173,6 +171,11 @@ class InterfaceAdmin(admin.ModelAdmin):
|
|
|
173
171
|
list_filter = 'colonel', 'type'
|
|
174
172
|
actions = 'broadcast_reset'
|
|
175
173
|
|
|
174
|
+
def get_queryset(self, request):
|
|
175
|
+
return super().get_queryset(request).filter(
|
|
176
|
+
colonel__instance=get_current_instance()
|
|
177
|
+
)
|
|
178
|
+
|
|
176
179
|
def broadcast_reset(self, request, queryset):
|
|
177
180
|
broadcasted = 0
|
|
178
181
|
for interface in queryset.filter(
|
simo/fleet/managers.py
CHANGED
|
@@ -8,7 +8,7 @@ class ColonelsManager(models.Manager):
|
|
|
8
8
|
qs = super().get_queryset()
|
|
9
9
|
instance = get_current_instance()
|
|
10
10
|
if instance:
|
|
11
|
-
qs = qs.filter(
|
|
11
|
+
qs = qs.filter(instance__is_active=True)
|
|
12
12
|
return qs
|
|
13
13
|
|
|
14
14
|
|
|
@@ -18,7 +18,7 @@ class ColonelPinsManager(models.Manager):
|
|
|
18
18
|
qs = super().get_queryset()
|
|
19
19
|
instance = get_current_instance()
|
|
20
20
|
if instance:
|
|
21
|
-
qs = qs.filter(
|
|
21
|
+
qs = qs.filter(colonel__instance__is_active=True)
|
|
22
22
|
return qs
|
|
23
23
|
|
|
24
24
|
|
|
@@ -28,7 +28,7 @@ class InterfacesManager(models.Manager):
|
|
|
28
28
|
qs = super().get_queryset()
|
|
29
29
|
instance = get_current_instance()
|
|
30
30
|
if instance:
|
|
31
|
-
qs = qs.filter(
|
|
31
|
+
qs = qs.filter(colonel__instance__is_active=True)
|
|
32
32
|
return qs
|
|
33
33
|
|
|
34
34
|
|
simo/fleet/socket_consumers.py
CHANGED
|
@@ -13,6 +13,7 @@ import paho.mqtt.client as mqtt
|
|
|
13
13
|
from channels.generic.websocket import AsyncWebsocketConsumer
|
|
14
14
|
from asgiref.sync import sync_to_async
|
|
15
15
|
from simo.core.utils.model_helpers import get_log_file_path
|
|
16
|
+
from simo.core.middleware import introduce_instance
|
|
16
17
|
from simo.core.utils.logs import capture_socket_errors
|
|
17
18
|
from simo.core.events import GatewayObjectCommand, get_event_obj
|
|
18
19
|
from simo.core.models import Gateway, Instance, Component
|
|
@@ -86,6 +87,8 @@ class FleetConsumer(AsyncWebsocketConsumer):
|
|
|
86
87
|
tz = await sync_to_async(get_tz, thread_sensitive=True)()
|
|
87
88
|
timezone.activate(tz)
|
|
88
89
|
|
|
90
|
+
introduce_instance(self.instance)
|
|
91
|
+
|
|
89
92
|
def get_colonel():
|
|
90
93
|
defaults={
|
|
91
94
|
'instance': self.instance,
|
|
@@ -237,6 +240,7 @@ class FleetConsumer(AsyncWebsocketConsumer):
|
|
|
237
240
|
}
|
|
238
241
|
|
|
239
242
|
def get_components(colonel):
|
|
243
|
+
introduce_instance(self.instance)
|
|
240
244
|
return list(
|
|
241
245
|
colonel.components.all().prefetch_related('slaves')
|
|
242
246
|
)
|
|
@@ -362,6 +366,7 @@ class FleetConsumer(AsyncWebsocketConsumer):
|
|
|
362
366
|
|
|
363
367
|
async def receive(self, text_data=None, bytes_data=None):
|
|
364
368
|
try:
|
|
369
|
+
introduce_instance(self.instance)
|
|
365
370
|
if text_data:
|
|
366
371
|
print(f"{self.colonel}: {text_data}")
|
|
367
372
|
data = json.loads(text_data)
|
|
@@ -10218,7 +10218,7 @@ simo/core/utils/__pycache__/serialization.cpython-38.pyc,sha256=9nTbzozDi8Avl6kr
|
|
|
10218
10218
|
simo/core/utils/__pycache__/type_constants.cpython-38.pyc,sha256=DEgtIL7cPWeIsjGaPf-qIHXzfOTJUJIBxDCbKDTs64s,3417
|
|
10219
10219
|
simo/core/utils/__pycache__/validators.cpython-38.pyc,sha256=gjeBOjL_keMoRDjdn8v-3F3wcjPIT3Xx5KpTalo0e-Y,1247
|
|
10220
10220
|
simo/fleet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10221
|
-
simo/fleet/admin.py,sha256=
|
|
10221
|
+
simo/fleet/admin.py,sha256=3udiNaNoL37699SN-rQqjvvZ0lO2pi2zvg9SqZPp5R0,6403
|
|
10222
10222
|
simo/fleet/api.py,sha256=bK-j762v-KsPIvdh2SQCVC3TZ0D_RZgAaIyOfyNifeU,3108
|
|
10223
10223
|
simo/fleet/auto_urls.py,sha256=UX66eR2ykMqFgfIllW-RTdjup5-FieCWl_BVm3CcXKg,702
|
|
10224
10224
|
simo/fleet/base_types.py,sha256=wL9RVkHr0gA7HI1wZq0pruGEIgvQqpfnCL4cC3ywsvw,102
|
|
@@ -10226,16 +10226,16 @@ simo/fleet/ble.py,sha256=eHA_9ABjbmH1vUVCv9hiPXQL2GZZSEVwfO0xyI1S0nI,1081
|
|
|
10226
10226
|
simo/fleet/controllers.py,sha256=fjri1GtCnflkkDpNqhTwy6i9CK6RDEB0Q_BtADzcG8E,29156
|
|
10227
10227
|
simo/fleet/forms.py,sha256=LbYphCtfpSxK3GwzSrcbMkB_spcspsf5FzYQFE9n-Q4,62614
|
|
10228
10228
|
simo/fleet/gateways.py,sha256=lKEJW0MgaOEiNnijH50DNSVChvaUT3TA3UurcI57P8k,5677
|
|
10229
|
-
simo/fleet/managers.py,sha256=
|
|
10229
|
+
simo/fleet/managers.py,sha256=ZNeHFSkF5kzsl9E1DCBevOW6kXJlD6kw0LU4B-JMOG8,828
|
|
10230
10230
|
simo/fleet/models.py,sha256=xAffeAh5hf8NC94B66ZqmYoF7qDN53wEQ1xE2E9D8Xc,17524
|
|
10231
10231
|
simo/fleet/routing.py,sha256=cofGsVWXMfPDwsJ6HM88xxtRxHwERhJ48Xyxc8mxg5o,149
|
|
10232
10232
|
simo/fleet/serializers.py,sha256=X2M0DFKVaxM6JFGDsdg3S2nJlLIcBvbujidZdfxD88w,2169
|
|
10233
|
-
simo/fleet/socket_consumers.py,sha256=
|
|
10233
|
+
simo/fleet/socket_consumers.py,sha256=nfwMAzHHDWrvmwOIfPJqYHgr2fF-OJ_l6gWOnljyFWI,18434
|
|
10234
10234
|
simo/fleet/tasks.py,sha256=AGq9BXFNAqkhOANsPvId8yjEbDtVCB3MRsi_AKDpgIM,821
|
|
10235
10235
|
simo/fleet/utils.py,sha256=wNJvURzLP3-aho3D3rfg07N9kWCaMIw5gOsmeeO9Nlg,4740
|
|
10236
10236
|
simo/fleet/views.py,sha256=jT3GcGv_JEj3dqyfHH2whCnGqwT8YEAuFxRgIX4Dk9w,3237
|
|
10237
10237
|
simo/fleet/__pycache__/__init__.cpython-38.pyc,sha256=pIZE7EL6-cuJ3pQtaSwjKLrKLsTYelp1k9sRhXKLh6s,159
|
|
10238
|
-
simo/fleet/__pycache__/admin.cpython-38.pyc,sha256=
|
|
10238
|
+
simo/fleet/__pycache__/admin.cpython-38.pyc,sha256=iweeu5AkaggBhQntP6-VF_eEodkNc6E7zKy0VjfwC2o,6652
|
|
10239
10239
|
simo/fleet/__pycache__/api.cpython-38.pyc,sha256=Ntc1sYKZMygW2eNTxVUgoeCF3StoUZcZA7ST7iYKrlg,3846
|
|
10240
10240
|
simo/fleet/__pycache__/auto_urls.cpython-38.pyc,sha256=Tc6a6BCXHjijP8U2jE2ghlJwnSNrGm59-hW5t-80wF0,689
|
|
10241
10241
|
simo/fleet/__pycache__/base_types.cpython-38.pyc,sha256=deyPwjpT6xZiFxBGFnj5b7R-lbdOTh2krgpJhrcGVhc,274
|
|
@@ -10243,11 +10243,11 @@ simo/fleet/__pycache__/ble.cpython-38.pyc,sha256=Nrof9w7cm4OlpFWHeVnmvvanh2_oF9o
|
|
|
10243
10243
|
simo/fleet/__pycache__/controllers.cpython-38.pyc,sha256=jtFHr_uyjCCeuidL-o-hGaf21u0fnxK_O6hTRdY6lpc,24906
|
|
10244
10244
|
simo/fleet/__pycache__/forms.cpython-38.pyc,sha256=tvoi9np3Empg1GYBFTChznEy09M0v6UBRaGz9FZCJxc,42300
|
|
10245
10245
|
simo/fleet/__pycache__/gateways.cpython-38.pyc,sha256=0RKVn0ndreVKhsrukqeLPSdMnRrsQ_W7yeVeBkRLfIk,5058
|
|
10246
|
-
simo/fleet/__pycache__/managers.cpython-38.pyc,sha256=
|
|
10246
|
+
simo/fleet/__pycache__/managers.cpython-38.pyc,sha256=Vmm23zoQnS3-uS5_WJt2n3wtjhLiEhLWaYxXJCU6Gts,1339
|
|
10247
10247
|
simo/fleet/__pycache__/models.cpython-38.pyc,sha256=d1Reu7cAryqGuA_Z0eqVsX7SFUo4_jNnyi1JbK7mWuI,14138
|
|
10248
10248
|
simo/fleet/__pycache__/routing.cpython-38.pyc,sha256=aPrCmxFKVyB8R8ZbJDwdPdFfvT7CvobovvZeq_mqRgY,314
|
|
10249
10249
|
simo/fleet/__pycache__/serializers.cpython-38.pyc,sha256=gIWHJaSUbTe9H_xerD29Fz7BxIqXNzBI60GsIVXbNdY,3134
|
|
10250
|
-
simo/fleet/__pycache__/socket_consumers.cpython-38.pyc,sha256=
|
|
10250
|
+
simo/fleet/__pycache__/socket_consumers.cpython-38.pyc,sha256=YUu6CroTABvoZGRHnE-bVno1-5pUWLSA0wOQkbrHfuo,14032
|
|
10251
10251
|
simo/fleet/__pycache__/tasks.cpython-38.pyc,sha256=RoNxL2WUiW67s9O9DjaYVVjCBSZu2nje0Qn9FJkWVS0,1116
|
|
10252
10252
|
simo/fleet/__pycache__/utils.cpython-38.pyc,sha256=obUd-X2Y-ybx4icqUWq_qwIxrP9yyarJjexWAfO4MTI,3344
|
|
10253
10253
|
simo/fleet/__pycache__/views.cpython-38.pyc,sha256=wilxSvZliSKQ5qC7JjWneYBSdbeZeTsF5uDrOQVmvms,3181
|
|
@@ -10561,9 +10561,9 @@ simo/users/templates/invitations/expired_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCe
|
|
|
10561
10561
|
simo/users/templates/invitations/expired_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10562
10562
|
simo/users/templates/invitations/taken_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10563
10563
|
simo/users/templates/invitations/taken_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10564
|
-
simo-2.5.
|
|
10565
|
-
simo-2.5.
|
|
10566
|
-
simo-2.5.
|
|
10567
|
-
simo-2.5.
|
|
10568
|
-
simo-2.5.
|
|
10569
|
-
simo-2.5.
|
|
10564
|
+
simo-2.5.25.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
|
|
10565
|
+
simo-2.5.25.dist-info/METADATA,sha256=0QbwBkQyX8aCdHsmCEsHZAP2gqvrBugk80H1VV06kRI,1924
|
|
10566
|
+
simo-2.5.25.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
10567
|
+
simo-2.5.25.dist-info/entry_points.txt,sha256=S9PwnUYmTSW7681GKDCxUbL0leRJIaRk6fDQIKgbZBA,135
|
|
10568
|
+
simo-2.5.25.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
|
|
10569
|
+
simo-2.5.25.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|