moonraker: don't send status updates for empty objects
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
0ed367d734
commit
25f9800f77
|
@ -463,12 +463,11 @@ class Server:
|
||||||
conn_status: Dict[str, Any] = {}
|
conn_status: Dict[str, Any] = {}
|
||||||
for name, fields in sub.items():
|
for name, fields in sub.items():
|
||||||
if name in status:
|
if name in status:
|
||||||
val: Dict[str, Any] = status[name]
|
val: Dict[str, Any] = dict(status[name])
|
||||||
if fields is None:
|
if fields is not None:
|
||||||
conn_status[name] = dict(val)
|
val = {k: v for k, v in val.items() if k in fields}
|
||||||
else:
|
if val:
|
||||||
conn_status[name] = {
|
conn_status[name] = val
|
||||||
k: v for k, v in val.items() if k in fields}
|
|
||||||
conn.send_status(conn_status, eventtime)
|
conn.send_status(conn_status, eventtime)
|
||||||
|
|
||||||
async def make_request(self, web_request: WebRequest) -> Any:
|
async def make_request(self, web_request: WebRequest) -> Any:
|
||||||
|
|
Loading…
Reference in New Issue