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