Idk
This commit is contained in:
@@ -911,15 +911,15 @@ class EdamamAPI:
|
|||||||
|
|
||||||
""")
|
""")
|
||||||
|
|
||||||
url = "https://api.edamam.com/api/vision/v1/nutrients"
|
url = "https://api.edamam.com/api/vision/v1/nutrients?app_id=09cb5bd7&app_key=8b2730f3c7f4f075cc939da3fa0c49fb&beta=true&servings=1"
|
||||||
|
|
||||||
# Query parameters as specified by the YAML schema
|
# Query parameters as specified by the YAML schema
|
||||||
params = {
|
# params = {
|
||||||
"app_id": EDAMAM_APP_ID__FOOD,
|
# "app_id": EDAMAM_APP_ID__FOOD,
|
||||||
"app_key": EDAMAM_APP_KEY__FOOD,
|
# "app_key": EDAMAM_APP_KEY__FOOD,
|
||||||
"beta": "true" # Recommended since vision is in Beta
|
# "beta": "true" # Recommended since vision is in Beta
|
||||||
}
|
# }
|
||||||
print("params:", params)
|
# print("params:", params)
|
||||||
|
|
||||||
# Specify the media type in the header
|
# Specify the media type in the header
|
||||||
headers = {
|
headers = {
|
||||||
@@ -932,7 +932,7 @@ class EdamamAPI:
|
|||||||
|
|
||||||
response = requests.post(
|
response = requests.post(
|
||||||
url,
|
url,
|
||||||
params=params,
|
# params=params,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
data=raw_image_bytes
|
data=raw_image_bytes
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -480,7 +480,7 @@ async def on_new_alert(alert: Alert):
|
|||||||
# Send the alert to the lora device
|
# Send the alert to the lora device
|
||||||
payload = payloads.lora_new_alert(alert)
|
payload = payloads.lora_new_alert(alert)
|
||||||
print(f"[Alert Handling] Sending alert to LoRa device: {payload}")
|
print(f"[Alert Handling] Sending alert to LoRa device: {payload}")
|
||||||
if lora.send_reliable(payload):
|
if lora.send_reliable(payload, max_retries=7):
|
||||||
microwave_states["2"].set_cooking_state(CookingStates.ALERT)
|
microwave_states["2"].set_cooking_state(CookingStates.ALERT)
|
||||||
|
|
||||||
# --- HARDWARE CONTROLLERS ---
|
# --- HARDWARE CONTROLLERS ---
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
DEBUG=True
|
DEBUG=True
|
||||||
DEBUG_MESSAGES=True
|
DEBUG_MESSAGES=True
|
||||||
DEBUG_DANGEROUS_AREA=False
|
DEBUG_DANGEROUS_AREA=False
|
||||||
DEBUG_TEMPERATURE_ALERT=True
|
DEBUG_TEMPERATURE_ALERT=False
|
||||||
DEBUG_SHORTER_COOKING_PLAN=True
|
DEBUG_SHORTER_COOKING_PLAN=True
|
||||||
DEBUG_DISHANALYZER=True
|
DEBUG_DISHANALYZER=True
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ class BaseLoraDevice:
|
|||||||
|
|
||||||
return packet
|
return packet
|
||||||
|
|
||||||
def send_reliable(self, payload, max_retries=4, ack_timeout=3.0):
|
def send_reliable(self, payload, max_retries=5, ack_timeout=3.0):
|
||||||
"""Sends a payload and listens in a single continuous RX window for the ACK."""
|
"""Sends a payload and listens in a single continuous RX window for the ACK."""
|
||||||
|
|
||||||
with self.tx_lock:
|
with self.tx_lock:
|
||||||
|
|||||||
Reference in New Issue
Block a user