From c8097aa26513d2d7496f0271434c33982963fa4e Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Mon, 10 Jul 2023 21:01:51 +0200 Subject: [PATCH] WIP: getconfig functionality --- itho-wpu.py | 1 + itho_i2c.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/itho-wpu.py b/itho-wpu.py index 68fcdd0..01b9629 100755 --- a/itho-wpu.py +++ b/itho-wpu.py @@ -23,6 +23,7 @@ actions = { "getserial": [0x90, 0xE1], "getdatatype": [0xA4, 0x00], "getdatalog": [0xA4, 0x01], + "getconfig": [0xC0, 0x30], "getsetting": [0xA4, 0x10], } diff --git a/itho_i2c.py b/itho_i2c.py index 82972a6..123041d 100644 --- a/itho_i2c.py +++ b/itho_i2c.py @@ -12,6 +12,7 @@ actions = { "getserial": [0x90, 0xE1], "getdatatype": [0xA4, 0x00], "getdatalog": [0xA4, 0x01], + "getconfig": [0xC0, 0x30], "getsetting": [0xA4, 0x10], } @@ -75,6 +76,8 @@ class I2CMaster: 0x00, ] ) + elif action == "getconfig": + request = [0x80] + actions[action] + [0x04, 0x04, 0x00, 0x00, 0x00, 0x0C] else: # 0x80 = source, 0x04 = msg_type, 0x00 = length request = [0x80] + actions[action] + [0x04, 0x00]