uecho.protocol package
Submodules
uecho.protocol.esv module
- class uecho.protocol.esv.ESV(code=0)
Bases:
objectESV represents a ESV code in a protocol message of Echonet Lite.
- NOTIFICATION = 115
- NOTIFICATION_REQUEST = 99
- NOTIFICATION_REQUEST_ERROR = 83
- NOTIFICATION_RESPONSE = 122
- NOTIFICATION_RESPONSE_REQUIRED = 116
- READ_REQUEST = 98
- READ_REQUEST_ERROR = 82
- READ_RESPONSE = 114
- UNKNOWN = 0
- WRITE_READ_REQUEST = 110
- WRITE_READ_REQUEST_ERROR = 94
- WRITE_READ_RESPONSE = 126
- WRITE_REQUEST = 96
- WRITE_REQUEST_ERROR = 80
- WRITE_REQUEST_RESPONSE_REQUIRED = 97
- WRITE_REQUEST_RESPONSE_REQUIRED_ERROR = 81
- WRITE_RESPONSE = 113
- is_notification() bool
Checks the ESV whether it is classified as a notification type.
- Returns:
True whether the specified code is a notification type, otherwise False.
- Return type:
bool
- is_notification_request() bool
Checks the ESV whether it is classified as a notification notification request type.
- Returns:
True whether the specified code is a notification request type, otherwise False.
- Return type:
bool
- is_notification_response() bool
Checks the ESV whether it is classified as a notification response type. :returns: True whether the specified code is a notification response type, otherwise False. :rtype: bool
- is_read_request() bool
Checks the ESV whether it is classified as a read request type.
- Returns:
True whether the specified code is a read request type, otherwise False.
- Return type:
bool
- is_read_response() bool
Checks the ESV whether it is classified as a read response type.
- Returns:
True whether the specified code is a read response type, otherwise False.
- Return type:
bool
- is_request() bool
Checks the ESV whether it is classified as a request type.
- Returns:
True whether the specified code is a request type, otherwise False.
- Return type:
bool
- is_response() bool
- is_response_required() bool
Checks the ESV whether it is classified as a response required type.
- Returns:
True whether the ESV requires the response, otherwise False.
- Return type:
bool
- is_write_read_request() bool
Checks the ESV whether it is classified as a write and read request type.
- Returns:
True whether the specified code is a write and read request type, otherwise False.
- Return type:
bool
- is_write_read_response() bool
Checks the ESV whether it is classified as a write and read response type.
- Returns:
True whether the specified code is a write and read response type, otherwise False.
- Return type:
bool
- is_write_request() bool
Checks the ESV whether it is classified as a write request type.
- Returns:
True whether the specified code is a write request type, otherwise False.
- Return type:
bool
- is_write_response() bool
Checks the ESV whether it is classified as a write response type.
- Returns:
True whether the specified code is a write response type, otherwise False.
- Return type:
bool
uecho.protocol.message module
- class uecho.protocol.message.Message
Bases:
ESVMessage represents a protocol message of Echonet Lite.
- DEOJ: int
- EHD1_ECHONET = 16
- EHD2_FORMAT1 = 129
- EOJ_SIZE = 3
- FORMAT1_HEADER_SIZE = 8
- FORMAT1_MIN_SIZE = 12
- FORMAT1_PROPERTY_HEADER_SIZE = 2
- FRAME_HEADER_SIZE = 4
- property OPC: int
- property OPCGet: int
- property OPCSet: int
- exception ParserError
Bases:
Exception
- SEOJ: int
- TID: int
- TID_MAX = 65535
- TID_SIZE = 2
- from_addr: Tuple[str, int] | None
- is_response_message(msg)
- parse_bytes(msg_bytes) bool
- parse_hexstring(hes_string: str) bool
- to_addr: Tuple[str, int] | None
- to_bytes() bytes
- to_string() str
uecho.protocol.observer module
uecho.protocol.property module
uecho.protocol.subject module
- class uecho.protocol.subject.Subject
Bases:
object- add_observer(observer) bool
Adds a message observer to the subject.
- Parameters:
Observer (observer) – A message observer.
- Returns:
Returns True when the specified observer is added, Otherwise False.
- Return type:
bool
Module contents
This module includes internal classes to handle any messages of Echonet Lite protocol.
- class uecho.protocol.ESV(code=0)
Bases:
objectESV represents a ESV code in a protocol message of Echonet Lite.
- NOTIFICATION = 115
- NOTIFICATION_REQUEST = 99
- NOTIFICATION_REQUEST_ERROR = 83
- NOTIFICATION_RESPONSE = 122
- NOTIFICATION_RESPONSE_REQUIRED = 116
- READ_REQUEST = 98
- READ_REQUEST_ERROR = 82
- READ_RESPONSE = 114
- UNKNOWN = 0
- WRITE_READ_REQUEST = 110
- WRITE_READ_REQUEST_ERROR = 94
- WRITE_READ_RESPONSE = 126
- WRITE_REQUEST = 96
- WRITE_REQUEST_ERROR = 80
- WRITE_REQUEST_RESPONSE_REQUIRED = 97
- WRITE_REQUEST_RESPONSE_REQUIRED_ERROR = 81
- WRITE_RESPONSE = 113
- is_notification() bool
Checks the ESV whether it is classified as a notification type.
- Returns:
True whether the specified code is a notification type, otherwise False.
- Return type:
bool
- is_notification_request() bool
Checks the ESV whether it is classified as a notification notification request type.
- Returns:
True whether the specified code is a notification request type, otherwise False.
- Return type:
bool
- is_notification_response() bool
Checks the ESV whether it is classified as a notification response type. :returns: True whether the specified code is a notification response type, otherwise False. :rtype: bool
- is_read_request() bool
Checks the ESV whether it is classified as a read request type.
- Returns:
True whether the specified code is a read request type, otherwise False.
- Return type:
bool
- is_read_response() bool
Checks the ESV whether it is classified as a read response type.
- Returns:
True whether the specified code is a read response type, otherwise False.
- Return type:
bool
- is_request() bool
Checks the ESV whether it is classified as a request type.
- Returns:
True whether the specified code is a request type, otherwise False.
- Return type:
bool
- is_response() bool
- is_response_required() bool
Checks the ESV whether it is classified as a response required type.
- Returns:
True whether the ESV requires the response, otherwise False.
- Return type:
bool
- is_write_read_request() bool
Checks the ESV whether it is classified as a write and read request type.
- Returns:
True whether the specified code is a write and read request type, otherwise False.
- Return type:
bool
- is_write_read_response() bool
Checks the ESV whether it is classified as a write and read response type.
- Returns:
True whether the specified code is a write and read response type, otherwise False.
- Return type:
bool
- is_write_request() bool
Checks the ESV whether it is classified as a write request type.
- Returns:
True whether the specified code is a write request type, otherwise False.
- Return type:
bool
- is_write_response() bool
Checks the ESV whether it is classified as a write response type.
- Returns:
True whether the specified code is a write response type, otherwise False.
- Return type:
bool
- class uecho.protocol.Message
Bases:
ESVMessage represents a protocol message of Echonet Lite.
- DEOJ: int
- EHD1_ECHONET = 16
- EHD2_FORMAT1 = 129
- EOJ_SIZE = 3
- FORMAT1_HEADER_SIZE = 8
- FORMAT1_MIN_SIZE = 12
- FORMAT1_PROPERTY_HEADER_SIZE = 2
- FRAME_HEADER_SIZE = 4
- property OPC: int
- property OPCGet: int
- property OPCSet: int
- exception ParserError
Bases:
Exception
- SEOJ: int
- TID: int
- TID_MAX = 65535
- TID_SIZE = 2
- from_addr: Tuple[str, int] | None
- is_response_message(msg)
- parse_bytes(msg_bytes) bool
- parse_hexstring(hes_string: str) bool
- to_addr: Tuple[str, int] | None
- to_bytes() bytes
- to_string() str
- class uecho.protocol.Observer
Bases:
objectObserver is an abstract observer class to listen to request messages to a device.
- class uecho.protocol.Property(code: int = 0, data: bytes = b'')
Bases:
objectProperty represents a property in a protocol message of Echonet Lite.
- code: int
- data: bytes
- class uecho.protocol.Subject
Bases:
object- add_observer(observer) bool
Adds a message observer to the subject.
- Parameters:
Observer (observer) – A message observer.
- Returns:
Returns True when the specified observer is added, Otherwise False.
- Return type:
bool