Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions iec62056_21/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def startup(self):

ident_msg = self.read_identification()

# Setting the baudrate to the one propsed by the device.
# Setting the baudrate to the one proposed by the device.
self._switchover_baudrate_char = ident_msg.switchover_baudrate_char
self.identification = ident_msg.identification
self.manufacturer_id = ident_msg.manufacturer
Expand Down Expand Up @@ -271,7 +271,7 @@ def send_battery_power_startup_sequence(self, fast=False):
Normal:
Null chars should be sent to the device for 2.1-2.3 seconds with a maximum
of 0,5 seconds between them.
After the last charachter the client shall wait 1.5-1,7 seconds until it
After the last character the client shall wait 1.5-1,7 seconds until it
sends the request message

:param fast:
Expand Down Expand Up @@ -305,7 +305,7 @@ def read_response(self, timeout=None):

:param timeout:
"""
data = self.transport.read()
data = self.transport.read(timeout)
if data.startswith(b"\x01"):
# We probably received a password challenge
return messages.CommandMessage.from_bytes(data)
Expand Down
14 changes: 7 additions & 7 deletions iec62056_21/lis200.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def parse_datetime(datetime_string, utc_offset=None):

class ArchiveReadoutCommand(Iec6205621Data):
"""
A spacial readout commnad is needed to read archives.
A spacial readout command is needed to read archives.

Each data row contains the measurements save at a certain point in time.
Each data row contains the measurements saved at a certain point in time.
Any range of the data in the archive can be read out. How to read the archive is
specified withing the data in the readout command. within the parenthesises.
specified within the data in the readout command within the parentheses.

For attributes !=0 there is only one data row in the answer.

Expand All @@ -52,10 +52,10 @@ class ArchiveReadoutCommand(Iec6205621Data):
Example if timestamp is the third value in the archive you need to set the
position to 3 to specify a time range. Defaults to `1`. Max value is 99.
:param str start: Lower limit (oldest data row) of the archive field to be read out.
Allowed lenght is 17 so it can contain timestamps. Defaults to `''` and if not
Allowed length is 17 so it can contain timestamps. Defaults to `''` and if not
present the oldest available row is used as lower limit
:param str end: Upper limit (newest data row) of the archive field to be read out.
Allowed lenght is 17 so it can contain timestamps. Defaults to `''` and if not
Allowed length is 17 so it can contain timestamps. Defaults to `''` and if not
present the newest available data row is used as the upper limit.
:param bool partial_blocks: Indicates if readout should be done via partial blocks.
Defaults to `False`.
Expand Down Expand Up @@ -150,8 +150,8 @@ def data(self):

for line in self.values.data_block.data_lines:

# other positions are refered without initial 0. But that wont work when
# referenceing a list.
# other positions are referred without initial 0. But that wont work when
# referencing a list.
datetime_index = self.datetime_position - 1

timestamp = parse_datetime(
Expand Down
6 changes: 3 additions & 3 deletions iec62056_21/transports.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def read(self, timeout: Optional[int] = None) -> bytes:
b = self.recv(1)

duration = time.time() - start_time
if duration > self.timeout:
if duration > timeout:
raise TimeoutError(f"Read in {self.__class__.__name__} timed out")
if not start_char_received:
# is start char?
Expand Down Expand Up @@ -86,7 +86,7 @@ def read(self, timeout: Optional[int] = None) -> bytes:
)

if start_char == b"\x01":
# This is a command message, probably Password challange.
# This is a command message, probably Password challenge.
total_data += in_data
break

Expand Down Expand Up @@ -371,7 +371,7 @@ def _recv(self, chars: int = 1) -> bytes:

def switch_baudrate(self, baud: int) -> None:
"""
Baudrate has not meaning in TCP/IP so we just dont do anything.
Baudrate has not meaning in TCP/IP so we just don't do anything.

:param baud:
"""
Expand Down