Skip to content

Commit aa79f38

Browse files
committed
- fixes an issue where PID buttons where not shown if CONTROL was just activated after app start
- fixes rendering of abbreviated subtitle (background profile title) with font Dijkstra - Acaia protocol handshake corrections - adds styling to container table - reduces default sample interval to 1s (from 2s) - rework of app styling
1 parent e8605cd commit aa79f38

12 files changed

Lines changed: 833 additions & 761 deletions

src/artisanlib/acaia.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ class ACAIA_TIMER(IntEnum):
236236

237237
HEARTBEAT_FREQUENCY:Final[int] = 5 # send the heartbeat every 5 sec
238238

239-
RELAY_STREAMING:Final[bool] = True # if set, configure Acaia relay (and COSMO) scales to streaming mode, otherwise they work in non-streaming mode reporting only weight changes
239+
RELAY_STREAMING:Final[bool] = False # if set, configure Acaia relay (and COSMO) scales to streaming mode, otherwise they work in non-streaming mode reporting only weight changes
240240
WEIGHT_ROUNDING:Final[bool] = False # if set, received weights are rounded to appropriate values based on scales readability
241241
# rounding for scales with readability>1 (to 4g), no rounding otherwise
242242

@@ -501,6 +501,8 @@ def reset_parser(self) -> None:
501501
def parse_info(self, data:bytes) -> None:
502502
if self._logging:
503503
_log.debug('INFO MSG: %s', data)
504+
else:
505+
_log.debug('INFO MSG received')
504506

505507
if len(data)>2:
506508
self.isp_version = data[2]
@@ -832,10 +834,9 @@ def parse_data(self, msg_type:int, data:bytes) -> None:
832834
self.parse_info(data)
833835
self.info_msg_received = True
834836
if not self.id_sent:
835-
self.send_ID() # send after very INFO_A as handshake confirmation
837+
self.send_ID() # send after every INFO_A as handshake confirmation
836838
elif msg_type == CMD.STATUS_A and self.info_msg_received:
837839
self.parse_status(data)
838-
self.id_sent = True # connection confirmed by device, no need for further handshake
839840
self.identify_device()
840841
elif msg_type == CMD.EVENT_SA:
841842
self.parse_scale_events(data)
@@ -848,9 +849,9 @@ def parse_data(self, msg_type:int, data:bytes) -> None:
848849
# Note: this event is needed to have the connected scale start to send weight messages even on relay scales which ignore the settings
849850
self.fast_notifications()
850851

851-
if not self.id_sent:
852-
# send ID only once per connect to initiate the handshake
853-
self.send_ID()
852+
# if not self.id_sent:
853+
# # send ID only once per connect to initiate the handshake, but never before receiving the INFO_A message
854+
# self.send_ID()
854855
except Exception as e: # pylint: disable=broad-except
855856
_log.exception(e)
856857
_log.debug('data: %s',data)

0 commit comments

Comments
 (0)