add image for bots in ecovacs home #68
4 changed files with 20 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -17,6 +17,7 @@ tests/*
|
|||
# Ignore logs/data/certs
|
||||
logs/*
|
||||
data/*
|
||||
!data/web*
|
||||
certs/*
|
||||
|
||||
# Except README in logs/data/certs
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import ssl
|
|||
import string
|
||||
import random
|
||||
import bumper
|
||||
import os
|
||||
from bumper.models import *
|
||||
from datetime import datetime, timedelta
|
||||
import asyncio
|
||||
|
|
@ -142,6 +143,7 @@ class ConfServer:
|
|||
"/api/dim/devmanager.do", self.handle_dim_devmanager
|
||||
), # EcoVacs Home
|
||||
web.post("/lookup.do", self.handle_lookup),
|
||||
web.get("/api/pim/file/get/{id}", self.handle_pimFile)
|
||||
]
|
||||
)
|
||||
# Direct register from app:
|
||||
|
|
@ -1275,6 +1277,16 @@ class ConfServer:
|
|||
except Exception as e:
|
||||
confserverlog.exception("{}".format(e))
|
||||
|
||||
|
||||
async def handle_pimFile(self, request):
|
||||
try:
|
||||
fileID = request.match_info.get("id", "")
|
||||
|
||||
return web.FileResponse(os.path.join(bumper.data_dir,"web","robotvac_image.jpg"))
|
||||
|
||||
except Exception as e:
|
||||
confserverlog.exception("{}".format(e))
|
||||
|
||||
async def disconnect(self):
|
||||
try:
|
||||
confserverlog.info("shutting down")
|
||||
|
|
|
|||
BIN
data/web/robotvac_image.jpg
Normal file
BIN
data/web/robotvac_image.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 143 KiB |
|
|
@ -497,6 +497,11 @@ async def test_getProductIotMap(aiohttp_client):
|
|||
assert jsonresp["code"] == bumper.RETURN_API_SUCCESS
|
||||
|
||||
|
||||
# Test getPimFile
|
||||
resp = await client.get("/api/pim/file/get/123")
|
||||
assert resp.status == 200
|
||||
|
||||
|
||||
async def test_getUsersAPI(aiohttp_client):
|
||||
remove_existing_db()
|
||||
bumper.db = "tests/tmp.db" # Set db location for testing
|
||||
|
|
@ -906,3 +911,5 @@ async def test_dim_devmanager(aiohttp_client):
|
|||
test_resp = json.loads(text)
|
||||
assert test_resp["ret"] == "fail"
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue