curaco desk: Be less noisy
This commit is contained in:
parent
0ddcdc4aeb
commit
6f8f877fb5
|
@ -1,7 +1,5 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
@ -53,7 +51,7 @@ in
|
|||
SystemCallFilter = [
|
||||
"@system-service"
|
||||
"~@privileged"
|
||||
"~@resouces"
|
||||
"~@resources"
|
||||
];
|
||||
UMask = "0077";
|
||||
};
|
||||
|
|
|
@ -33,7 +33,7 @@ class Desk:
|
|||
# https://www.linak.nl/technische-ondersteuning/#/cbd4-cbd6s-configurator
|
||||
# Connects, and settings can be changed.
|
||||
# Don't think there's much that would help with our problem.
|
||||
# Decompiled with Ghidra (hard), didn't go super far
|
||||
# Tried to decompile with Ghidra (hard), didn't go super far
|
||||
|
||||
VEND = 0x12D3
|
||||
PROD = 0x0002
|
||||
|
@ -265,7 +265,7 @@ class Desk:
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
logging.basicConfig()
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
desk = Desk()
|
||||
|
@ -344,10 +344,17 @@ if __name__ == "__main__":
|
|||
)
|
||||
height_min = ha_mqtt_discoverable.sensors.Sensor(height_min_settings)
|
||||
|
||||
last_published_state = None
|
||||
|
||||
def fetch_callback(desk: Desk) -> None:
|
||||
log.debug("Received state, sending")
|
||||
hcur = desk.get_height()
|
||||
hmin, hmax = desk.get_height_bounds()
|
||||
global last_published_state
|
||||
|
||||
state = hcur, hmin, hmax
|
||||
if state == last_published_state:
|
||||
return
|
||||
last_published_state = state
|
||||
|
||||
# If none this will set as unknown
|
||||
# Also readings can be a bit outside the boundaries,
|
||||
|
|
Loading…
Reference in a new issue