prevent writing battery json when there has been no change, filter out devices with unknown state
C++ / fmt (pull_request) Successful in 4s
JS/TS / fmt (pull_request) Successful in 11s
JS/TS / lint (pull_request) Successful in 15s
Python / fmt (pull_request) Successful in 29s
Python / lint (pull_request) Successful in 32s
Python / test (pull_request) Successful in 1m4s
Python / typecheck (pull_request) Failing after 1m10s
C++ / build (pull_request) Successful in 1m35s
Rust / fmt (pull_request) Successful in 36s
Rust / build (pull_request) Successful in 1m34s
Rust / clippy (pull_request) Successful in 1m28s
Python / buildcheck (pull_request) Successful in 2m35s
C++ / clang-tidy (pull_request) Successful in 3m32s
C++ / fmt (pull_request) Successful in 4s
JS/TS / fmt (pull_request) Successful in 11s
JS/TS / lint (pull_request) Successful in 15s
Python / fmt (pull_request) Successful in 29s
Python / lint (pull_request) Successful in 32s
Python / test (pull_request) Successful in 1m4s
Python / typecheck (pull_request) Failing after 1m10s
C++ / build (pull_request) Successful in 1m35s
Rust / fmt (pull_request) Successful in 36s
Rust / build (pull_request) Successful in 1m34s
Rust / clippy (pull_request) Successful in 1m28s
Python / buildcheck (pull_request) Successful in 2m35s
C++ / clang-tidy (pull_request) Successful in 3m32s
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@ Singleton {
|
|||||||
readonly property bool ready: UPower.displayDevice.ready
|
readonly property bool ready: UPower.displayDevice.ready
|
||||||
readonly property real timeToEmpty: UPower.displayDevice.timeToEmpty
|
readonly property real timeToEmpty: UPower.displayDevice.timeToEmpty
|
||||||
readonly property real timeToFull: UPower.displayDevice.timeToFull
|
readonly property real timeToFull: UPower.displayDevice.timeToFull
|
||||||
readonly property list<UPowerDevice> upowerDevices: UPower.devices.values
|
readonly property list<UPowerDevice> upowerDevices: UPower.devices.values.filter(d => d.state !== UPowerDeviceState.Unknown)
|
||||||
|
|
||||||
function getColors(percentage: real, state: string): var {
|
function getColors(percentage: real, state: string): var {
|
||||||
if (state === "charging" || state === "full" || state === "recharging")
|
if (state === "charging" || state === "full" || state === "recharging")
|
||||||
|
|||||||
@@ -229,11 +229,15 @@ def daemon(
|
|||||||
|
|
||||||
typer.echo(f"Polling every {interval}s, writing to {out}")
|
typer.echo(f"Polling every {interval}s, writing to {out}")
|
||||||
|
|
||||||
|
last_payload = None
|
||||||
try:
|
try:
|
||||||
while running:
|
while running:
|
||||||
try:
|
try:
|
||||||
results = poll_once()
|
results = poll_once()
|
||||||
_write_json_atomic(out, results)
|
payload = [asdict(r) for r in results]
|
||||||
|
if payload != last_payload:
|
||||||
|
_write_json_atomic(out, results)
|
||||||
|
last_payload = payload
|
||||||
except RuntimeError as e:
|
except RuntimeError as e:
|
||||||
typer.echo(f"error: {e}", err=True)
|
typer.echo(f"error: {e}", err=True)
|
||||||
raise typer.Exit(code=1) from None
|
raise typer.Exit(code=1) from None
|
||||||
|
|||||||
Reference in New Issue
Block a user