From 17779c231bc9d9e1ba125dc6093b310f5d529747 Mon Sep 17 00:00:00 2001 From: Ryan Summers Date: Thu, 1 Feb 2024 16:00:07 +0100 Subject: [PATCH] Updating python --- Cargo.toml | 2 ++ py/setup.py | 3 ++- py/thermostat/configure_output_ch.py | 12 ++++++------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b133274..bdc9eb3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,6 +42,8 @@ byteorder = { version = "1", default-features = false } smlang = "0.6.0" enum-iterator = "1.4.0" idsp = "0.9.2" + +# Note: Keep in-sync with `py/setup.py` miniconf = "0.9" [profile.dev] diff --git a/py/setup.py b/py/setup.py index a654744..5e05057 100644 --- a/py/setup.py +++ b/py/setup.py @@ -14,6 +14,7 @@ license="MIT", install_requires=[ "stabilizer@git+https://github.com/quartiq/stabilizer@f4055aa#subdirectory=py", - "miniconf-mqtt@git+https://github.com/quartiq/miniconf@8be449d#subdirectory=py/miniconf-mqtt", + # Note: Keep in-sync with `Cargo.toml` + "miniconf-mqtt@git+https://github.com/quartiq/miniconf@v0.9.0#subdirectory=py/miniconf-mqtt", ], ) diff --git a/py/thermostat/configure_output_ch.py b/py/thermostat/configure_output_ch.py index 299d28c..3ed9e1e 100644 --- a/py/thermostat/configure_output_ch.py +++ b/py/thermostat/configure_output_ch.py @@ -23,7 +23,7 @@ def _main(): "--broker", "-b", type=str, - default="10.42.0.1", + default="mqtt", help="The MQTT broker to use to communicate with " "Thermostat-EEM (%(default)s)", ) @@ -152,19 +152,19 @@ async def configure(): interface = await miniconf.Miniconf.create(prefix, args.broker) # Set the filter coefficients. - await interface.command( + await interface.set( f"output_channel/{args.channel}/shutdown", args.shutdown, ) - await interface.command( + await interface.set( f"output_channel/{args.channel}/hold", args.hold, ) - await interface.command( + await interface.set( f"output_channel/{args.channel}/voltage_limit", args.voltage_limit, ) - await interface.command( + await interface.set( f"output_channel/{args.channel}/iir", { "ba": coefficients, @@ -174,7 +174,7 @@ async def configure(): }, ) for i, weight in enumerate(args.input_weights): - await interface.command( + await interface.set( f"output_channel/{args.channel}/weights/{i}", weight, )