simo 1.7.2__py3-none-any.whl → 1.7.4__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/models.py +1 -1
- simo/fleet/socket_consumers.py +19 -0
- simo/fleet/tasks.py +0 -4
- {simo-1.7.2.dist-info → simo-1.7.4.dist-info}/METADATA +1 -1
- {simo-1.7.2.dist-info → simo-1.7.4.dist-info}/RECORD +8 -8
- {simo-1.7.2.dist-info → simo-1.7.4.dist-info}/LICENSE.md +0 -0
- {simo-1.7.2.dist-info → simo-1.7.4.dist-info}/WHEEL +0 -0
- {simo-1.7.2.dist-info → simo-1.7.4.dist-info}/top_level.txt +0 -0
simo/fleet/models.py
CHANGED
|
@@ -118,7 +118,7 @@ class Colonel(DirtyFieldsMixin, models.Model):
|
|
|
118
118
|
return False
|
|
119
119
|
if not self.last_seen:
|
|
120
120
|
return False
|
|
121
|
-
return
|
|
121
|
+
return True
|
|
122
122
|
|
|
123
123
|
def newer_firmware_available(self):
|
|
124
124
|
updates = []
|
simo/fleet/socket_consumers.py
CHANGED
|
@@ -145,6 +145,25 @@ class FleetConsumer(AsyncWebsocketConsumer):
|
|
|
145
145
|
'command': 'set_config', 'data': config
|
|
146
146
|
}))
|
|
147
147
|
|
|
148
|
+
asyncio.create_task(self.watch_connection())
|
|
149
|
+
|
|
150
|
+
async def watch_connection(self):
|
|
151
|
+
while self.connected:
|
|
152
|
+
await sync_to_async(
|
|
153
|
+
self.colonel.refresh_from_db, thread_sensitive=True
|
|
154
|
+
)()
|
|
155
|
+
|
|
156
|
+
if self.colonel.firmware_auto_update \
|
|
157
|
+
and self.colonel.minor_upgrade_available:
|
|
158
|
+
await self.firmware_update(
|
|
159
|
+
self.colonel.minor_upgrade_available
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
await asyncio.sleep(10)
|
|
163
|
+
# Default pinging system sometimes get's lost somewhere,
|
|
164
|
+
# therefore we use our own to ensure connection
|
|
165
|
+
await self.send(json.dumps({'command': 'ping'}))
|
|
166
|
+
|
|
148
167
|
async def firmware_update(self, to_version):
|
|
149
168
|
print("Firmware update: ", str(self.colonel))
|
|
150
169
|
await self.send(json.dumps({'command': 'ota_update', 'version': to_version}))
|
simo/fleet/tasks.py
CHANGED
|
@@ -10109,11 +10109,11 @@ simo/fleet/ble.py,sha256=eHA_9ABjbmH1vUVCv9hiPXQL2GZZSEVwfO0xyI1S0nI,1081
|
|
|
10109
10109
|
simo/fleet/controllers.py,sha256=voctXyfEXDWpMxPoUpG_6bKAeawIWViktQACu2krgFo,8073
|
|
10110
10110
|
simo/fleet/forms.py,sha256=mG7yUbjzhSFy3hCnIrmFxxslZziq51qcBmd2_7zPIJ8,41720
|
|
10111
10111
|
simo/fleet/gateways.py,sha256=W87o1P8Nubf3_v1RNn134rivHCiYIHbj4Za4sRQzSqw,204
|
|
10112
|
-
simo/fleet/models.py,sha256=
|
|
10112
|
+
simo/fleet/models.py,sha256=4SHPX7HuZBfNwSkoDFwJjgNQs3oaSbhw_j85cXAxkqE,10092
|
|
10113
10113
|
simo/fleet/routing.py,sha256=cofGsVWXMfPDwsJ6HM88xxtRxHwERhJ48Xyxc8mxg5o,149
|
|
10114
10114
|
simo/fleet/serializers.py,sha256=uz_OE_bMdlE_C28gnBpUP0P08FdZKvFP-hgRKvJRYT0,348
|
|
10115
|
-
simo/fleet/socket_consumers.py,sha256=
|
|
10116
|
-
simo/fleet/tasks.py,sha256=
|
|
10115
|
+
simo/fleet/socket_consumers.py,sha256=wt6aXI4YY7GFij0QfuqoGgTxkoIFn3aFD2DvXz6Y_v4,11746
|
|
10116
|
+
simo/fleet/tasks.py,sha256=QcMgXUE2V--CsNfzmbW35F-Q3b8D53-Q6twlWOow2Ig,704
|
|
10117
10117
|
simo/fleet/utils.py,sha256=ZGxN94Wp472SEZRXVC6ZkUd2dmh_tMHc0qbMtoMfDRg,4511
|
|
10118
10118
|
simo/fleet/views.py,sha256=1AwE_JC13n76JiM3cQ__8CgBidCoRFUbJN-Yaz1s4HQ,1198
|
|
10119
10119
|
simo/fleet/migrations/0001_initial.py,sha256=lce8nkD8Sz6pYr-XJSpDm4CMDuB6TA__WtnHpIp-eA4,1326
|
|
@@ -10313,8 +10313,8 @@ simo/users/templates/invitations/expired_msg.html,sha256=3hTtUm-Cr1axOjlwAIKsSj9
|
|
|
10313
10313
|
simo/users/templates/invitations/expired_suggestion.html,sha256=pT67ludJdeohrlF0QIzs4eqy1SI_oH2i6H0ecEIgaCg,100
|
|
10314
10314
|
simo/users/templates/invitations/taken_msg.html,sha256=Dv1MaxVVmSdL20gri4Ei-K0aZ0OTmIdmO6a3l5MKwCs,445
|
|
10315
10315
|
simo/users/templates/invitations/taken_suggestion.html,sha256=NCE2XQail0WQGW8v6y3BkQoM3IOWlh02z9XPEws659E,301
|
|
10316
|
-
simo-1.7.
|
|
10317
|
-
simo-1.7.
|
|
10318
|
-
simo-1.7.
|
|
10319
|
-
simo-1.7.
|
|
10320
|
-
simo-1.7.
|
|
10316
|
+
simo-1.7.4.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
|
|
10317
|
+
simo-1.7.4.dist-info/METADATA,sha256=mTGpYdlNate2rc64dXBjuxD3ob9oY35bwDpMMuFNbP0,1748
|
|
10318
|
+
simo-1.7.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
10319
|
+
simo-1.7.4.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
|
|
10320
|
+
simo-1.7.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|