From 23551ae82956c238ca2d8587d401a5d9b2afc40d Mon Sep 17 00:00:00 2001 From: Artem Chepurnyi Date: Sat, 29 Jun 2024 16:42:32 +0300 Subject: [PATCH] improvement: Add ARM and DSP versions --- .DS_Store | Bin 0 -> 6148 bytes .../base_devices/ProtocolV1Device.py | 2 ++ .../bluetti_bt_lib/field_attributes.py | 8 ++++++++ 3 files changed, 10 insertions(+) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..adde28060660a2acf75b8048b5fc8ccfb587e153 GIT binary patch literal 6148 zcmeHKU279T6upzCX17I%pv4zq!PgRF{ea?2nkEkg^`R^Jpc1p)rCGb#4cSdY34uH+ z{s;epZ~heji%)v)%(U!oA}EMRm&vuf71_0}CEQ#b2pleFC*zvkMDB#FGsa^HIy z2Gd^s=3x?N{V)#3(joK%P~N->V?UX;lS%BS($`fTmTlR+`p#_D+;#T$AI*22+5R5N z4<9_9&u#10-Fr`tduP!wPCj5wFo6?T8t-V{KBDp)N}apoI7;GEuz4h#^@o-b)V#p1 zq%bp1TsEW{C>gFlxJ^Vu~$V+o(adbFdZ@0_FAmQEW#*Y6!@D8@cG~% zF}5@=6w0FmnS25Ot7w*nvi$20bhrW7(zsBF7MM`3K;ii7 zXT~^sW}#mwLO(o&Bk3es3QcYlFbWhE*ih9v-~ZiTzyFI)re+i{3apg^qS|pgZ7fOO ztxJpJyVgN^hs4Ibg+l3qOkc;cz*q5YBx&e#xBzTvTqr~f%={6MGMLOL@J|)^2`4h< AVgLXD literal 0 HcmV?d00001 diff --git a/custom_components/bluetti_bt/bluetti_bt_lib/base_devices/ProtocolV1Device.py b/custom_components/bluetti_bt/bluetti_bt_lib/base_devices/ProtocolV1Device.py index 8160342..a8c4532 100644 --- a/custom_components/bluetti_bt/bluetti_bt_lib/base_devices/ProtocolV1Device.py +++ b/custom_components/bluetti_bt/bluetti_bt_lib/base_devices/ProtocolV1Device.py @@ -14,6 +14,8 @@ class ProtocolV1Device(BluettiDevice): # Device info self.struct.add_string_field("device_type", 10, 6) self.struct.add_sn_field("serial_number", 17) + self.struct.add_version_field('arm_version', 23) + self.struct.add_version_field('dsp_version', 25) # Power IO self.struct.add_uint_field("dc_input_power", 36) diff --git a/custom_components/bluetti_bt/bluetti_bt_lib/field_attributes.py b/custom_components/bluetti_bt/bluetti_bt_lib/field_attributes.py index db9707e..bcb4182 100644 --- a/custom_components/bluetti_bt/bluetti_bt_lib/field_attributes.py +++ b/custom_components/bluetti_bt/bluetti_bt_lib/field_attributes.py @@ -125,6 +125,14 @@ FIELD_ATTRIBUTES: dict[str, FieldAttributes] = { "ac_input_power": PowerFieldAttributes("AC Input Power"), "ac_output_power": PowerFieldAttributes("AC Output Power"), "dc_output_power": PowerFieldAttributes("DC Output Power"), + "dsp_version": FieldAttributes( + type=FieldType.NUMERIC, + name=f"DSP Version", + ), + "arm_version": FieldAttributes( + type=FieldType.NUMERIC, + name=f"ARM Version", + ), "power_generation": EnergyFieldAttributes("Total Power Generation"), "total_battery_percent": FieldAttributes( type=FieldType.NUMERIC,