added pack fields to base devices
This commit is contained in:
1 parent
cac64b40bd
commit
01cb7f35a5
3 files changed
+53
-2
No files matched your search
@@ -27,6 +27,13 @@ class ProtocolV1Device(BluettiDevice):
|
||||
# Battery
|
||||
self.struct.add_uint_field('total_battery_percent', 43)
|
||||
|
||||
# Battery packs
|
||||
self.struct.add_uint_field('pack_num_max', 91) # internal
|
||||
self.struct.add_decimal_field('total_battery_voltage', 92, 1)
|
||||
self.struct.add_uint_field('pack_num', 96) # internal
|
||||
self.struct.add_decimal_field('pack_voltage', 98, 2) # Full pack voltage
|
||||
self.struct.add_uint_field('pack_battery_percent', 99)
|
||||
|
||||
# Output state
|
||||
self.struct.add_bool_field('ac_output_on', 48)
|
||||
self.struct.add_bool_field('dc_output_on', 49)
|
||||
@@ -42,7 +49,11 @@ class ProtocolV1Device(BluettiDevice):
|
||||
return [
|
||||
ReadHoldingRegisters(10, 10),
|
||||
ReadHoldingRegisters(36, 4),
|
||||
ReadHoldingRegisters(41, 1),
|
||||
ReadHoldingRegisters(43, 1),
|
||||
ReadHoldingRegisters(91, 2),
|
||||
ReadHoldingRegisters(96, 1),
|
||||
ReadHoldingRegisters(98, 2),
|
||||
ReadHoldingRegisters(48, 2),
|
||||
]
|
||||
|
||||
|
||||
@@ -27,6 +27,13 @@ class ProtocolV2Device(BluettiDevice):
|
||||
# Battery
|
||||
self.struct.add_uint_field('total_battery_percent', 102)
|
||||
|
||||
# Battery packs
|
||||
#self.struct.add_uint_field('pack_num_max', ?) # internal
|
||||
#self.struct.add_decimal_field('total_battery_voltage', ?, 1)
|
||||
#self.struct.add_uint_field('pack_num', ?) # internal
|
||||
#self.struct.add_decimal_field('pack_voltage', ?, 2) # Full pack voltage
|
||||
#self.struct.add_uint_field('pack_battery_percent', ?)
|
||||
|
||||
# Output state
|
||||
#self.struct.add_bool_field('ac_output_on', ?)
|
||||
#self.struct.add_bool_field('dc_output_on', ?)
|
||||
@@ -44,6 +51,7 @@ class ProtocolV2Device(BluettiDevice):
|
||||
return [
|
||||
ReadHoldingRegisters(110, 6),
|
||||
ReadHoldingRegisters(116, 4),
|
||||
ReadHoldingRegisters(154, 1),
|
||||
ReadHoldingRegisters(102, 1),
|
||||
]
|
||||
|
||||
|
||||
Reference in new issue
Block a user