Skip to content

Commit

Permalink
More lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
elupus committed Feb 12, 2024
1 parent 749ea01 commit 24f8878
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion RFXtrx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,12 +1034,13 @@ def __init__(self, device, event_callback=None,
self._sensors = {}
self._status = None
self._modes = modes
self._thread = threading.Thread(target=self._connect, daemon=True)
self.event_callback = event_callback
self.transport: RFXtrxTransport = transport_protocol(device)

def connect(self, timeout=None):
"""Connect to device."""
self.transport.connect(timeout)
self._thread = threading.Thread(target=self._connect, daemon=True)
self._thread.start()
if not self._run_event.wait(timeout):
self.close_connection()
Expand All @@ -1052,6 +1053,7 @@ def _connect(self):
_LOGGER.info("Connection lost %s", exception)
except Exception:
_LOGGER.exception("Unexpected exception from transport")
raise
finally:
if self.event_callback and self._run_event.is_set():
self.event_callback(ConnectionLost())
Expand Down
4 changes: 2 additions & 2 deletions RFXtrx/lowlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2278,7 +2278,7 @@ def load_receive(self, data):
(data[10] << 8) + data[11])
self.prodwatthours = ((data[12] * pow(2, 24)) + (data[13] << 16) +
(data[14] << 8) + data[15])
self.tarif_num = (data[16] & 0x0f)
self.tarif_num = data[16] & 0x0f
self.voltage = data[17] + 200
self.currentwatt = (data[18] << 8) + data[19]
self.state_byte = data[20]
Expand Down Expand Up @@ -2378,7 +2378,7 @@ def set_transmit(self, subtype, seqnbr, id1, id2, sound):
self.id2 = id2
self.sound = sound
self.rssi = 0
self.rssi_byte = (self.rssi << 4)
self.rssi_byte = self.rssi << 4
self.data = bytearray([self.packetlength, self.packettype,
self.subtype, self.seqnbr,
self.id1, self.id2, self.sound,
Expand Down

0 comments on commit 24f8878

Please sign in to comment.