Fix import error
This commit is contained in:
+5
-4
@@ -2,10 +2,6 @@ from time import time
|
|||||||
from shared.deviceTypes import DEVICE_TYPES
|
from shared.deviceTypes import DEVICE_TYPES
|
||||||
from shared.alerts import Alert, AlertType
|
from shared.alerts import Alert, AlertType
|
||||||
import shared.config as config
|
import shared.config as config
|
||||||
try:
|
|
||||||
from shared.lora_device import LoraCommands
|
|
||||||
except ImportError:
|
|
||||||
pass # No need
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -74,6 +70,11 @@ def telemetry_payload(device_id, microwave_states, button_state, cloud_alert, gp
|
|||||||
})
|
})
|
||||||
|
|
||||||
def lora_new_alert(alert: Alert):
|
def lora_new_alert(alert: Alert):
|
||||||
|
try:
|
||||||
|
from shared.lora_device import LoraCommands
|
||||||
|
except ImportError:
|
||||||
|
pass # No need
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"action": LoraCommands.NEW_ALERT,
|
"action": LoraCommands.NEW_ALERT,
|
||||||
"alert_type": alert.alertType
|
"alert_type": alert.alertType
|
||||||
|
|||||||
Reference in New Issue
Block a user