2019-02-14 04:35:12 +00:00
|
|
|
"""Support for Modbus."""
|
2021-04-10 13:21:11 +00:00
|
|
|
from __future__ import annotations
|
|
|
|
|
2021-05-10 17:28:38 +00:00
|
|
|
import logging
|
2021-04-10 13:21:11 +00:00
|
|
|
from typing import Any
|
2021-03-27 21:48:06 +00:00
|
|
|
|
2016-09-13 20:47:44 +00:00
|
|
|
import voluptuous as vol
|
|
|
|
|
2021-03-27 21:48:06 +00:00
|
|
|
from homeassistant.components.binary_sensor import (
|
|
|
|
DEVICE_CLASSES_SCHEMA as BINARY_SENSOR_DEVICE_CLASSES_SCHEMA,
|
|
|
|
)
|
2020-09-26 16:11:51 +00:00
|
|
|
from homeassistant.components.cover import (
|
|
|
|
DEVICE_CLASSES_SCHEMA as COVER_DEVICE_CLASSES_SCHEMA,
|
|
|
|
)
|
2021-03-27 21:48:06 +00:00
|
|
|
from homeassistant.components.sensor import (
|
|
|
|
DEVICE_CLASSES_SCHEMA as SENSOR_DEVICE_CLASSES_SCHEMA,
|
|
|
|
)
|
|
|
|
from homeassistant.components.switch import (
|
|
|
|
DEVICE_CLASSES_SCHEMA as SWITCH_DEVICE_CLASSES_SCHEMA,
|
|
|
|
)
|
2016-02-19 05:27:50 +00:00
|
|
|
from homeassistant.const import (
|
2021-03-27 21:48:06 +00:00
|
|
|
CONF_ADDRESS,
|
2021-04-04 12:02:47 +00:00
|
|
|
CONF_BINARY_SENSORS,
|
2021-03-27 21:48:06 +00:00
|
|
|
CONF_COMMAND_OFF,
|
|
|
|
CONF_COMMAND_ON,
|
2021-04-04 12:02:47 +00:00
|
|
|
CONF_COUNT,
|
2020-09-26 16:11:51 +00:00
|
|
|
CONF_COVERS,
|
Modbus patch, to allow communication with "slow" equipment using tcp (#32557)
* modbus: bumb pymodbus version to 2.3.0
pymodbus version 1.5.2 did not support asyncio, and in general
the async handling have been improved a lot in version 2.3.0.
updated core/requirement*txt
* updated core/CODEOWNERS
committing result of 'python3 -m script.hassfest'.
* modbus: change core connection to async
change setup() --> async_setup and update() --> async_update()
Use async_setup_platform() to complete the async connection to core.
listen for EVENT_HOMEASSISTANT_START happens in async_setup()
so it needs to be async_listen.
But listen for EVENT_HOMEASSISTANT_STOP happens in start_modbus()
which is a sync. function so it continues to be listen().
* modbus: move setup of pymodbus into modbushub
setup of pymodbus is logically connected to the class modbushub,
therefore move it into the class.
Delay construction of pymodbus client until event
EVENT_HOMEASSISTANT_START arrives.
* modbus: use pymodbus async library
convert pymodbus calls to refer to the async library.
Remark: connect() is no longer needed, it is done when constructing
the client. There are also automatic reconnect.
* modbus: use async update for read/write
Use async functions for read/write from pymodbus.
change thread.Lock() to asyncio.Lock()
* Modbus: patch for slow tcp equipment
When connecting, via Modbus-TCP, so some equipment (like the
huawei sun2000 inverter), they need time to prepare the protocol.
Solution is to add a asyncio.sleep(x) after the connect() and before
sending the first message.
Add optional parameter "delay" to Modbus configuration.
Default is 0, which means do not execute asyncio.sleep().
* Modbus: silence pylint false positive
pylint does not accept that a class construction __new__
can return a tuple.
* Modbus: move constants to const.py
Create const.py with constants only used in
the modbus integration.
Duplicate entries are removed, but NOT any entry that would
lead to a configuration change.
Some entries were the same but with different names, in this
case renaming is done.
Also correct the tests.
* Modbus: move connection error handling to ModbusHub
Connection error handling depends on the hub, not the
entity, therefore it is logical to have the handling in
ModbusHub.
All pymodbus call are added to 2 generic functions (read/write)
in order not to duplicate the error handling code.
Added property "available" to signal if the hub is connected.
* Modbus: CI cleanup
Solve CI problems.
* Modbus: remove close of client
close() no longer exist in the pymodbus library, use
del client instead.
* Modbus: correct review comments
Adjust code based on review comments.
* Modbus: remove twister dependency
Pymodbus in asyncio mode do not use twister but still throws a
warning if twister is not installed, this warning goes into
homeassistant.log and can thus cause confusion among users.
However installing twister just to avoid the warning is not
the best solution, therefore removing dependency on twister.
* Modbus: review, remove comments.
remove commented out code.
2020-03-29 17:39:30 +00:00
|
|
|
CONF_DELAY,
|
2020-09-26 16:11:51 +00:00
|
|
|
CONF_DEVICE_CLASS,
|
2019-07-31 19:25:30 +00:00
|
|
|
CONF_HOST,
|
2021-05-21 06:57:17 +00:00
|
|
|
CONF_LIGHTS,
|
2019-07-31 19:25:30 +00:00
|
|
|
CONF_METHOD,
|
|
|
|
CONF_NAME,
|
2021-02-11 12:58:16 +00:00
|
|
|
CONF_OFFSET,
|
2019-07-31 19:25:30 +00:00
|
|
|
CONF_PORT,
|
2020-09-26 16:11:51 +00:00
|
|
|
CONF_SCAN_INTERVAL,
|
2021-04-04 12:02:47 +00:00
|
|
|
CONF_SENSORS,
|
2020-09-26 16:11:51 +00:00
|
|
|
CONF_SLAVE,
|
2020-10-07 20:43:16 +00:00
|
|
|
CONF_STRUCTURE,
|
2021-04-04 12:02:47 +00:00
|
|
|
CONF_SWITCHES,
|
|
|
|
CONF_TEMPERATURE_UNIT,
|
2019-07-31 19:25:30 +00:00
|
|
|
CONF_TIMEOUT,
|
|
|
|
CONF_TYPE,
|
2021-03-27 21:48:06 +00:00
|
|
|
CONF_UNIT_OF_MEASUREMENT,
|
2019-07-31 19:25:30 +00:00
|
|
|
)
|
2019-02-24 09:22:17 +00:00
|
|
|
import homeassistant.helpers.config_validation as cv
|
2015-04-15 14:47:42 +00:00
|
|
|
|
2020-03-29 23:35:58 +00:00
|
|
|
from .const import (
|
Modbus patch, to allow communication with "slow" equipment using tcp (#32557)
* modbus: bumb pymodbus version to 2.3.0
pymodbus version 1.5.2 did not support asyncio, and in general
the async handling have been improved a lot in version 2.3.0.
updated core/requirement*txt
* updated core/CODEOWNERS
committing result of 'python3 -m script.hassfest'.
* modbus: change core connection to async
change setup() --> async_setup and update() --> async_update()
Use async_setup_platform() to complete the async connection to core.
listen for EVENT_HOMEASSISTANT_START happens in async_setup()
so it needs to be async_listen.
But listen for EVENT_HOMEASSISTANT_STOP happens in start_modbus()
which is a sync. function so it continues to be listen().
* modbus: move setup of pymodbus into modbushub
setup of pymodbus is logically connected to the class modbushub,
therefore move it into the class.
Delay construction of pymodbus client until event
EVENT_HOMEASSISTANT_START arrives.
* modbus: use pymodbus async library
convert pymodbus calls to refer to the async library.
Remark: connect() is no longer needed, it is done when constructing
the client. There are also automatic reconnect.
* modbus: use async update for read/write
Use async functions for read/write from pymodbus.
change thread.Lock() to asyncio.Lock()
* Modbus: patch for slow tcp equipment
When connecting, via Modbus-TCP, so some equipment (like the
huawei sun2000 inverter), they need time to prepare the protocol.
Solution is to add a asyncio.sleep(x) after the connect() and before
sending the first message.
Add optional parameter "delay" to Modbus configuration.
Default is 0, which means do not execute asyncio.sleep().
* Modbus: silence pylint false positive
pylint does not accept that a class construction __new__
can return a tuple.
* Modbus: move constants to const.py
Create const.py with constants only used in
the modbus integration.
Duplicate entries are removed, but NOT any entry that would
lead to a configuration change.
Some entries were the same but with different names, in this
case renaming is done.
Also correct the tests.
* Modbus: move connection error handling to ModbusHub
Connection error handling depends on the hub, not the
entity, therefore it is logical to have the handling in
ModbusHub.
All pymodbus call are added to 2 generic functions (read/write)
in order not to duplicate the error handling code.
Added property "available" to signal if the hub is connected.
* Modbus: CI cleanup
Solve CI problems.
* Modbus: remove close of client
close() no longer exist in the pymodbus library, use
del client instead.
* Modbus: correct review comments
Adjust code based on review comments.
* Modbus: remove twister dependency
Pymodbus in asyncio mode do not use twister but still throws a
warning if twister is not installed, this warning goes into
homeassistant.log and can thus cause confusion among users.
However installing twister just to avoid the warning is not
the best solution, therefore removing dependency on twister.
* Modbus: review, remove comments.
remove commented out code.
2020-03-29 17:39:30 +00:00
|
|
|
ATTR_ADDRESS,
|
|
|
|
ATTR_HUB,
|
2021-04-04 12:02:47 +00:00
|
|
|
ATTR_STATE,
|
Modbus patch, to allow communication with "slow" equipment using tcp (#32557)
* modbus: bumb pymodbus version to 2.3.0
pymodbus version 1.5.2 did not support asyncio, and in general
the async handling have been improved a lot in version 2.3.0.
updated core/requirement*txt
* updated core/CODEOWNERS
committing result of 'python3 -m script.hassfest'.
* modbus: change core connection to async
change setup() --> async_setup and update() --> async_update()
Use async_setup_platform() to complete the async connection to core.
listen for EVENT_HOMEASSISTANT_START happens in async_setup()
so it needs to be async_listen.
But listen for EVENT_HOMEASSISTANT_STOP happens in start_modbus()
which is a sync. function so it continues to be listen().
* modbus: move setup of pymodbus into modbushub
setup of pymodbus is logically connected to the class modbushub,
therefore move it into the class.
Delay construction of pymodbus client until event
EVENT_HOMEASSISTANT_START arrives.
* modbus: use pymodbus async library
convert pymodbus calls to refer to the async library.
Remark: connect() is no longer needed, it is done when constructing
the client. There are also automatic reconnect.
* modbus: use async update for read/write
Use async functions for read/write from pymodbus.
change thread.Lock() to asyncio.Lock()
* Modbus: patch for slow tcp equipment
When connecting, via Modbus-TCP, so some equipment (like the
huawei sun2000 inverter), they need time to prepare the protocol.
Solution is to add a asyncio.sleep(x) after the connect() and before
sending the first message.
Add optional parameter "delay" to Modbus configuration.
Default is 0, which means do not execute asyncio.sleep().
* Modbus: silence pylint false positive
pylint does not accept that a class construction __new__
can return a tuple.
* Modbus: move constants to const.py
Create const.py with constants only used in
the modbus integration.
Duplicate entries are removed, but NOT any entry that would
lead to a configuration change.
Some entries were the same but with different names, in this
case renaming is done.
Also correct the tests.
* Modbus: move connection error handling to ModbusHub
Connection error handling depends on the hub, not the
entity, therefore it is logical to have the handling in
ModbusHub.
All pymodbus call are added to 2 generic functions (read/write)
in order not to duplicate the error handling code.
Added property "available" to signal if the hub is connected.
* Modbus: CI cleanup
Solve CI problems.
* Modbus: remove close of client
close() no longer exist in the pymodbus library, use
del client instead.
* Modbus: correct review comments
Adjust code based on review comments.
* Modbus: remove twister dependency
Pymodbus in asyncio mode do not use twister but still throws a
warning if twister is not installed, this warning goes into
homeassistant.log and can thus cause confusion among users.
However installing twister just to avoid the warning is not
the best solution, therefore removing dependency on twister.
* Modbus: review, remove comments.
remove commented out code.
2020-03-29 17:39:30 +00:00
|
|
|
ATTR_UNIT,
|
|
|
|
ATTR_VALUE,
|
2020-09-26 16:11:51 +00:00
|
|
|
CALL_TYPE_COIL,
|
2021-03-27 21:48:06 +00:00
|
|
|
CALL_TYPE_DISCRETE,
|
2020-09-26 16:11:51 +00:00
|
|
|
CALL_TYPE_REGISTER_HOLDING,
|
|
|
|
CALL_TYPE_REGISTER_INPUT,
|
Modbus patch, to allow communication with "slow" equipment using tcp (#32557)
* modbus: bumb pymodbus version to 2.3.0
pymodbus version 1.5.2 did not support asyncio, and in general
the async handling have been improved a lot in version 2.3.0.
updated core/requirement*txt
* updated core/CODEOWNERS
committing result of 'python3 -m script.hassfest'.
* modbus: change core connection to async
change setup() --> async_setup and update() --> async_update()
Use async_setup_platform() to complete the async connection to core.
listen for EVENT_HOMEASSISTANT_START happens in async_setup()
so it needs to be async_listen.
But listen for EVENT_HOMEASSISTANT_STOP happens in start_modbus()
which is a sync. function so it continues to be listen().
* modbus: move setup of pymodbus into modbushub
setup of pymodbus is logically connected to the class modbushub,
therefore move it into the class.
Delay construction of pymodbus client until event
EVENT_HOMEASSISTANT_START arrives.
* modbus: use pymodbus async library
convert pymodbus calls to refer to the async library.
Remark: connect() is no longer needed, it is done when constructing
the client. There are also automatic reconnect.
* modbus: use async update for read/write
Use async functions for read/write from pymodbus.
change thread.Lock() to asyncio.Lock()
* Modbus: patch for slow tcp equipment
When connecting, via Modbus-TCP, so some equipment (like the
huawei sun2000 inverter), they need time to prepare the protocol.
Solution is to add a asyncio.sleep(x) after the connect() and before
sending the first message.
Add optional parameter "delay" to Modbus configuration.
Default is 0, which means do not execute asyncio.sleep().
* Modbus: silence pylint false positive
pylint does not accept that a class construction __new__
can return a tuple.
* Modbus: move constants to const.py
Create const.py with constants only used in
the modbus integration.
Duplicate entries are removed, but NOT any entry that would
lead to a configuration change.
Some entries were the same but with different names, in this
case renaming is done.
Also correct the tests.
* Modbus: move connection error handling to ModbusHub
Connection error handling depends on the hub, not the
entity, therefore it is logical to have the handling in
ModbusHub.
All pymodbus call are added to 2 generic functions (read/write)
in order not to duplicate the error handling code.
Added property "available" to signal if the hub is connected.
* Modbus: CI cleanup
Solve CI problems.
* Modbus: remove close of client
close() no longer exist in the pymodbus library, use
del client instead.
* Modbus: correct review comments
Adjust code based on review comments.
* Modbus: remove twister dependency
Pymodbus in asyncio mode do not use twister but still throws a
warning if twister is not installed, this warning goes into
homeassistant.log and can thus cause confusion among users.
However installing twister just to avoid the warning is not
the best solution, therefore removing dependency on twister.
* Modbus: review, remove comments.
remove commented out code.
2020-03-29 17:39:30 +00:00
|
|
|
CONF_BAUDRATE,
|
|
|
|
CONF_BYTESIZE,
|
2020-10-07 20:43:16 +00:00
|
|
|
CONF_CLIMATES,
|
2021-05-14 08:54:23 +00:00
|
|
|
CONF_CLOSE_COMM_ON_ERROR,
|
2020-10-07 20:43:16 +00:00
|
|
|
CONF_CURRENT_TEMP,
|
|
|
|
CONF_CURRENT_TEMP_REGISTER_TYPE,
|
|
|
|
CONF_DATA_COUNT,
|
|
|
|
CONF_DATA_TYPE,
|
2021-05-21 07:56:47 +00:00
|
|
|
CONF_FANS,
|
2020-09-26 16:11:51 +00:00
|
|
|
CONF_INPUT_TYPE,
|
2020-10-07 20:43:16 +00:00
|
|
|
CONF_MAX_TEMP,
|
|
|
|
CONF_MIN_TEMP,
|
Modbus patch, to allow communication with "slow" equipment using tcp (#32557)
* modbus: bumb pymodbus version to 2.3.0
pymodbus version 1.5.2 did not support asyncio, and in general
the async handling have been improved a lot in version 2.3.0.
updated core/requirement*txt
* updated core/CODEOWNERS
committing result of 'python3 -m script.hassfest'.
* modbus: change core connection to async
change setup() --> async_setup and update() --> async_update()
Use async_setup_platform() to complete the async connection to core.
listen for EVENT_HOMEASSISTANT_START happens in async_setup()
so it needs to be async_listen.
But listen for EVENT_HOMEASSISTANT_STOP happens in start_modbus()
which is a sync. function so it continues to be listen().
* modbus: move setup of pymodbus into modbushub
setup of pymodbus is logically connected to the class modbushub,
therefore move it into the class.
Delay construction of pymodbus client until event
EVENT_HOMEASSISTANT_START arrives.
* modbus: use pymodbus async library
convert pymodbus calls to refer to the async library.
Remark: connect() is no longer needed, it is done when constructing
the client. There are also automatic reconnect.
* modbus: use async update for read/write
Use async functions for read/write from pymodbus.
change thread.Lock() to asyncio.Lock()
* Modbus: patch for slow tcp equipment
When connecting, via Modbus-TCP, so some equipment (like the
huawei sun2000 inverter), they need time to prepare the protocol.
Solution is to add a asyncio.sleep(x) after the connect() and before
sending the first message.
Add optional parameter "delay" to Modbus configuration.
Default is 0, which means do not execute asyncio.sleep().
* Modbus: silence pylint false positive
pylint does not accept that a class construction __new__
can return a tuple.
* Modbus: move constants to const.py
Create const.py with constants only used in
the modbus integration.
Duplicate entries are removed, but NOT any entry that would
lead to a configuration change.
Some entries were the same but with different names, in this
case renaming is done.
Also correct the tests.
* Modbus: move connection error handling to ModbusHub
Connection error handling depends on the hub, not the
entity, therefore it is logical to have the handling in
ModbusHub.
All pymodbus call are added to 2 generic functions (read/write)
in order not to duplicate the error handling code.
Added property "available" to signal if the hub is connected.
* Modbus: CI cleanup
Solve CI problems.
* Modbus: remove close of client
close() no longer exist in the pymodbus library, use
del client instead.
* Modbus: correct review comments
Adjust code based on review comments.
* Modbus: remove twister dependency
Pymodbus in asyncio mode do not use twister but still throws a
warning if twister is not installed, this warning goes into
homeassistant.log and can thus cause confusion among users.
However installing twister just to avoid the warning is not
the best solution, therefore removing dependency on twister.
* Modbus: review, remove comments.
remove commented out code.
2020-03-29 17:39:30 +00:00
|
|
|
CONF_PARITY,
|
2020-10-07 20:43:16 +00:00
|
|
|
CONF_PRECISION,
|
2020-09-26 16:11:51 +00:00
|
|
|
CONF_REGISTER,
|
2021-03-27 21:48:06 +00:00
|
|
|
CONF_REVERSE_ORDER,
|
2020-10-07 20:43:16 +00:00
|
|
|
CONF_SCALE,
|
2020-09-26 16:11:51 +00:00
|
|
|
CONF_STATE_CLOSED,
|
|
|
|
CONF_STATE_CLOSING,
|
2021-03-27 21:48:06 +00:00
|
|
|
CONF_STATE_OFF,
|
|
|
|
CONF_STATE_ON,
|
2020-09-26 16:11:51 +00:00
|
|
|
CONF_STATE_OPEN,
|
|
|
|
CONF_STATE_OPENING,
|
|
|
|
CONF_STATUS_REGISTER,
|
|
|
|
CONF_STATUS_REGISTER_TYPE,
|
2020-10-07 20:43:16 +00:00
|
|
|
CONF_STEP,
|
Modbus patch, to allow communication with "slow" equipment using tcp (#32557)
* modbus: bumb pymodbus version to 2.3.0
pymodbus version 1.5.2 did not support asyncio, and in general
the async handling have been improved a lot in version 2.3.0.
updated core/requirement*txt
* updated core/CODEOWNERS
committing result of 'python3 -m script.hassfest'.
* modbus: change core connection to async
change setup() --> async_setup and update() --> async_update()
Use async_setup_platform() to complete the async connection to core.
listen for EVENT_HOMEASSISTANT_START happens in async_setup()
so it needs to be async_listen.
But listen for EVENT_HOMEASSISTANT_STOP happens in start_modbus()
which is a sync. function so it continues to be listen().
* modbus: move setup of pymodbus into modbushub
setup of pymodbus is logically connected to the class modbushub,
therefore move it into the class.
Delay construction of pymodbus client until event
EVENT_HOMEASSISTANT_START arrives.
* modbus: use pymodbus async library
convert pymodbus calls to refer to the async library.
Remark: connect() is no longer needed, it is done when constructing
the client. There are also automatic reconnect.
* modbus: use async update for read/write
Use async functions for read/write from pymodbus.
change thread.Lock() to asyncio.Lock()
* Modbus: patch for slow tcp equipment
When connecting, via Modbus-TCP, so some equipment (like the
huawei sun2000 inverter), they need time to prepare the protocol.
Solution is to add a asyncio.sleep(x) after the connect() and before
sending the first message.
Add optional parameter "delay" to Modbus configuration.
Default is 0, which means do not execute asyncio.sleep().
* Modbus: silence pylint false positive
pylint does not accept that a class construction __new__
can return a tuple.
* Modbus: move constants to const.py
Create const.py with constants only used in
the modbus integration.
Duplicate entries are removed, but NOT any entry that would
lead to a configuration change.
Some entries were the same but with different names, in this
case renaming is done.
Also correct the tests.
* Modbus: move connection error handling to ModbusHub
Connection error handling depends on the hub, not the
entity, therefore it is logical to have the handling in
ModbusHub.
All pymodbus call are added to 2 generic functions (read/write)
in order not to duplicate the error handling code.
Added property "available" to signal if the hub is connected.
* Modbus: CI cleanup
Solve CI problems.
* Modbus: remove close of client
close() no longer exist in the pymodbus library, use
del client instead.
* Modbus: correct review comments
Adjust code based on review comments.
* Modbus: remove twister dependency
Pymodbus in asyncio mode do not use twister but still throws a
warning if twister is not installed, this warning goes into
homeassistant.log and can thus cause confusion among users.
However installing twister just to avoid the warning is not
the best solution, therefore removing dependency on twister.
* Modbus: review, remove comments.
remove commented out code.
2020-03-29 17:39:30 +00:00
|
|
|
CONF_STOPBITS,
|
2021-04-27 08:49:41 +00:00
|
|
|
CONF_SWAP,
|
|
|
|
CONF_SWAP_BYTE,
|
|
|
|
CONF_SWAP_NONE,
|
|
|
|
CONF_SWAP_WORD,
|
|
|
|
CONF_SWAP_WORD_BYTE,
|
2020-10-07 20:43:16 +00:00
|
|
|
CONF_TARGET_TEMP,
|
2021-04-30 14:47:18 +00:00
|
|
|
CONF_VERIFY,
|
|
|
|
CONF_WRITE_TYPE,
|
2020-10-07 20:43:16 +00:00
|
|
|
DATA_TYPE_CUSTOM,
|
|
|
|
DATA_TYPE_FLOAT,
|
|
|
|
DATA_TYPE_INT,
|
2021-03-27 21:48:06 +00:00
|
|
|
DATA_TYPE_STRING,
|
2020-10-07 20:43:16 +00:00
|
|
|
DATA_TYPE_UINT,
|
2020-03-29 23:35:58 +00:00
|
|
|
DEFAULT_HUB,
|
2020-09-26 16:11:51 +00:00
|
|
|
DEFAULT_SCAN_INTERVAL,
|
2020-10-07 20:43:16 +00:00
|
|
|
DEFAULT_STRUCTURE_PREFIX,
|
|
|
|
DEFAULT_TEMP_UNIT,
|
2021-05-10 17:28:38 +00:00
|
|
|
MINIMUM_SCAN_INTERVAL,
|
2020-04-09 20:15:20 +00:00
|
|
|
MODBUS_DOMAIN as DOMAIN,
|
2021-05-10 17:28:38 +00:00
|
|
|
PLATFORMS,
|
Modbus patch, to allow communication with "slow" equipment using tcp (#32557)
* modbus: bumb pymodbus version to 2.3.0
pymodbus version 1.5.2 did not support asyncio, and in general
the async handling have been improved a lot in version 2.3.0.
updated core/requirement*txt
* updated core/CODEOWNERS
committing result of 'python3 -m script.hassfest'.
* modbus: change core connection to async
change setup() --> async_setup and update() --> async_update()
Use async_setup_platform() to complete the async connection to core.
listen for EVENT_HOMEASSISTANT_START happens in async_setup()
so it needs to be async_listen.
But listen for EVENT_HOMEASSISTANT_STOP happens in start_modbus()
which is a sync. function so it continues to be listen().
* modbus: move setup of pymodbus into modbushub
setup of pymodbus is logically connected to the class modbushub,
therefore move it into the class.
Delay construction of pymodbus client until event
EVENT_HOMEASSISTANT_START arrives.
* modbus: use pymodbus async library
convert pymodbus calls to refer to the async library.
Remark: connect() is no longer needed, it is done when constructing
the client. There are also automatic reconnect.
* modbus: use async update for read/write
Use async functions for read/write from pymodbus.
change thread.Lock() to asyncio.Lock()
* Modbus: patch for slow tcp equipment
When connecting, via Modbus-TCP, so some equipment (like the
huawei sun2000 inverter), they need time to prepare the protocol.
Solution is to add a asyncio.sleep(x) after the connect() and before
sending the first message.
Add optional parameter "delay" to Modbus configuration.
Default is 0, which means do not execute asyncio.sleep().
* Modbus: silence pylint false positive
pylint does not accept that a class construction __new__
can return a tuple.
* Modbus: move constants to const.py
Create const.py with constants only used in
the modbus integration.
Duplicate entries are removed, but NOT any entry that would
lead to a configuration change.
Some entries were the same but with different names, in this
case renaming is done.
Also correct the tests.
* Modbus: move connection error handling to ModbusHub
Connection error handling depends on the hub, not the
entity, therefore it is logical to have the handling in
ModbusHub.
All pymodbus call are added to 2 generic functions (read/write)
in order not to duplicate the error handling code.
Added property "available" to signal if the hub is connected.
* Modbus: CI cleanup
Solve CI problems.
* Modbus: remove close of client
close() no longer exist in the pymodbus library, use
del client instead.
* Modbus: correct review comments
Adjust code based on review comments.
* Modbus: remove twister dependency
Pymodbus in asyncio mode do not use twister but still throws a
warning if twister is not installed, this warning goes into
homeassistant.log and can thus cause confusion among users.
However installing twister just to avoid the warning is not
the best solution, therefore removing dependency on twister.
* Modbus: review, remove comments.
remove commented out code.
2020-03-29 17:39:30 +00:00
|
|
|
)
|
2021-05-15 17:54:17 +00:00
|
|
|
from .modbus import async_modbus_setup
|
2021-05-26 17:28:14 +00:00
|
|
|
from .validators import sensor_schema_validator
|
2019-07-31 19:25:30 +00:00
|
|
|
|
2021-05-10 17:28:38 +00:00
|
|
|
_LOGGER = logging.getLogger(__name__)
|
|
|
|
|
2019-07-31 19:25:30 +00:00
|
|
|
BASE_SCHEMA = vol.Schema({vol.Optional(CONF_NAME, default=DEFAULT_HUB): cv.string})
|
|
|
|
|
2021-03-27 21:48:06 +00:00
|
|
|
|
2021-04-10 13:21:11 +00:00
|
|
|
def number(value: Any) -> int | float:
|
2021-03-27 21:48:06 +00:00
|
|
|
"""Coerce a value to number without losing precision."""
|
|
|
|
if isinstance(value, int):
|
|
|
|
return value
|
|
|
|
if isinstance(value, float):
|
|
|
|
return value
|
|
|
|
|
|
|
|
try:
|
|
|
|
value = int(value)
|
|
|
|
return value
|
|
|
|
except (TypeError, ValueError):
|
|
|
|
pass
|
|
|
|
try:
|
|
|
|
value = float(value)
|
|
|
|
return value
|
|
|
|
except (TypeError, ValueError) as err:
|
|
|
|
raise vol.Invalid(f"invalid number {value}") from err
|
|
|
|
|
|
|
|
|
2021-05-10 17:28:38 +00:00
|
|
|
def control_scan_interval(config: dict) -> dict:
|
|
|
|
"""Control scan_interval."""
|
|
|
|
for hub in config:
|
|
|
|
minimum_scan_interval = DEFAULT_SCAN_INTERVAL
|
|
|
|
for component, conf_key in PLATFORMS:
|
|
|
|
if conf_key not in hub:
|
|
|
|
continue
|
|
|
|
|
|
|
|
for entry in hub[conf_key]:
|
|
|
|
scan_interval = entry.get(CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL)
|
|
|
|
if scan_interval < MINIMUM_SCAN_INTERVAL:
|
2021-05-24 10:59:55 +00:00
|
|
|
if scan_interval == 0:
|
|
|
|
continue
|
2021-05-10 17:28:38 +00:00
|
|
|
_LOGGER.warning(
|
|
|
|
"%s %s scan_interval(%d) is adjusted to minimum(%d)",
|
|
|
|
component,
|
|
|
|
entry.get(CONF_NAME),
|
|
|
|
scan_interval,
|
|
|
|
MINIMUM_SCAN_INTERVAL,
|
|
|
|
)
|
|
|
|
scan_interval = MINIMUM_SCAN_INTERVAL
|
|
|
|
entry[CONF_SCAN_INTERVAL] = scan_interval
|
|
|
|
minimum_scan_interval = min(scan_interval, minimum_scan_interval)
|
|
|
|
if CONF_TIMEOUT in hub and hub[CONF_TIMEOUT] > minimum_scan_interval - 1:
|
|
|
|
_LOGGER.warning(
|
|
|
|
"Modbus %s timeout(%d) is adjusted(%d) due to scan_interval",
|
|
|
|
hub.get(CONF_NAME, ""),
|
|
|
|
hub[CONF_TIMEOUT],
|
|
|
|
minimum_scan_interval - 1,
|
|
|
|
)
|
|
|
|
hub[CONF_TIMEOUT] = minimum_scan_interval - 1
|
|
|
|
return config
|
|
|
|
|
|
|
|
|
2021-03-27 21:48:06 +00:00
|
|
|
BASE_COMPONENT_SCHEMA = vol.Schema(
|
2020-10-07 20:43:16 +00:00
|
|
|
{
|
|
|
|
vol.Required(CONF_NAME): cv.string,
|
2021-03-27 21:48:06 +00:00
|
|
|
vol.Optional(CONF_SLAVE): cv.positive_int,
|
|
|
|
vol.Optional(
|
|
|
|
CONF_SCAN_INTERVAL, default=DEFAULT_SCAN_INTERVAL
|
|
|
|
): cv.positive_int,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
CLIMATE_SCHEMA = BASE_COMPONENT_SCHEMA.extend(
|
|
|
|
{
|
|
|
|
vol.Required(CONF_CURRENT_TEMP): cv.positive_int,
|
2020-10-07 20:43:16 +00:00
|
|
|
vol.Required(CONF_TARGET_TEMP): cv.positive_int,
|
|
|
|
vol.Optional(CONF_DATA_COUNT, default=2): cv.positive_int,
|
|
|
|
vol.Optional(
|
|
|
|
CONF_CURRENT_TEMP_REGISTER_TYPE, default=CALL_TYPE_REGISTER_HOLDING
|
|
|
|
): vol.In([CALL_TYPE_REGISTER_HOLDING, CALL_TYPE_REGISTER_INPUT]),
|
|
|
|
vol.Optional(CONF_DATA_TYPE, default=DATA_TYPE_FLOAT): vol.In(
|
|
|
|
[DATA_TYPE_INT, DATA_TYPE_UINT, DATA_TYPE_FLOAT, DATA_TYPE_CUSTOM]
|
|
|
|
),
|
|
|
|
vol.Optional(CONF_PRECISION, default=1): cv.positive_int,
|
|
|
|
vol.Optional(CONF_SCALE, default=1): vol.Coerce(float),
|
|
|
|
vol.Optional(CONF_OFFSET, default=0): vol.Coerce(float),
|
|
|
|
vol.Optional(CONF_MAX_TEMP, default=35): cv.positive_int,
|
|
|
|
vol.Optional(CONF_MIN_TEMP, default=5): cv.positive_int,
|
|
|
|
vol.Optional(CONF_STEP, default=0.5): vol.Coerce(float),
|
|
|
|
vol.Optional(CONF_STRUCTURE, default=DEFAULT_STRUCTURE_PREFIX): cv.string,
|
2021-04-04 12:02:47 +00:00
|
|
|
vol.Optional(CONF_TEMPERATURE_UNIT, default=DEFAULT_TEMP_UNIT): cv.string,
|
2020-10-07 20:43:16 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2020-09-26 16:11:51 +00:00
|
|
|
COVERS_SCHEMA = vol.All(
|
|
|
|
cv.has_at_least_one_key(CALL_TYPE_COIL, CONF_REGISTER),
|
2021-03-27 21:48:06 +00:00
|
|
|
BASE_COMPONENT_SCHEMA.extend(
|
2020-09-26 16:11:51 +00:00
|
|
|
{
|
|
|
|
vol.Optional(CONF_DEVICE_CLASS): COVER_DEVICE_CLASSES_SCHEMA,
|
|
|
|
vol.Optional(CONF_STATE_CLOSED, default=0): cv.positive_int,
|
|
|
|
vol.Optional(CONF_STATE_CLOSING, default=3): cv.positive_int,
|
|
|
|
vol.Optional(CONF_STATE_OPEN, default=1): cv.positive_int,
|
|
|
|
vol.Optional(CONF_STATE_OPENING, default=2): cv.positive_int,
|
|
|
|
vol.Optional(CONF_STATUS_REGISTER): cv.positive_int,
|
|
|
|
vol.Optional(
|
|
|
|
CONF_STATUS_REGISTER_TYPE,
|
|
|
|
default=CALL_TYPE_REGISTER_HOLDING,
|
|
|
|
): vol.In([CALL_TYPE_REGISTER_HOLDING, CALL_TYPE_REGISTER_INPUT]),
|
|
|
|
vol.Exclusive(CALL_TYPE_COIL, CONF_INPUT_TYPE): cv.positive_int,
|
|
|
|
vol.Exclusive(CONF_REGISTER, CONF_INPUT_TYPE): cv.positive_int,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
2021-03-27 21:48:06 +00:00
|
|
|
SWITCH_SCHEMA = BASE_COMPONENT_SCHEMA.extend(
|
|
|
|
{
|
|
|
|
vol.Required(CONF_ADDRESS): cv.positive_int,
|
|
|
|
vol.Optional(CONF_DEVICE_CLASS): SWITCH_DEVICE_CLASSES_SCHEMA,
|
2021-04-30 14:47:18 +00:00
|
|
|
vol.Optional(CONF_WRITE_TYPE, default=CALL_TYPE_REGISTER_HOLDING): vol.In(
|
|
|
|
[CALL_TYPE_REGISTER_HOLDING, CALL_TYPE_COIL]
|
2021-03-27 21:48:06 +00:00
|
|
|
),
|
|
|
|
vol.Optional(CONF_COMMAND_OFF, default=0x00): cv.positive_int,
|
|
|
|
vol.Optional(CONF_COMMAND_ON, default=0x01): cv.positive_int,
|
2021-05-07 20:12:13 +00:00
|
|
|
vol.Optional(CONF_VERIFY): vol.Maybe(
|
|
|
|
{
|
|
|
|
vol.Optional(CONF_ADDRESS): cv.positive_int,
|
|
|
|
vol.Optional(CONF_INPUT_TYPE): vol.In(
|
|
|
|
[
|
|
|
|
CALL_TYPE_REGISTER_HOLDING,
|
|
|
|
CALL_TYPE_DISCRETE,
|
|
|
|
CALL_TYPE_REGISTER_INPUT,
|
|
|
|
CALL_TYPE_COIL,
|
|
|
|
]
|
|
|
|
),
|
|
|
|
vol.Optional(CONF_STATE_OFF): cv.positive_int,
|
|
|
|
vol.Optional(CONF_STATE_ON): cv.positive_int,
|
2021-05-24 10:59:55 +00:00
|
|
|
vol.Optional(CONF_DELAY, default=0): cv.positive_int,
|
2021-05-07 20:12:13 +00:00
|
|
|
}
|
|
|
|
),
|
2021-03-27 21:48:06 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2021-05-21 06:57:17 +00:00
|
|
|
LIGHT_SCHEMA = BASE_COMPONENT_SCHEMA.extend(
|
|
|
|
{
|
|
|
|
vol.Required(CONF_ADDRESS): cv.positive_int,
|
|
|
|
vol.Optional(CONF_WRITE_TYPE, default=CALL_TYPE_REGISTER_HOLDING): vol.In(
|
|
|
|
[CALL_TYPE_REGISTER_HOLDING, CALL_TYPE_COIL]
|
|
|
|
),
|
|
|
|
vol.Optional(CONF_COMMAND_OFF, default=0x00): cv.positive_int,
|
|
|
|
vol.Optional(CONF_COMMAND_ON, default=0x01): cv.positive_int,
|
|
|
|
vol.Optional(CONF_VERIFY): vol.Maybe(
|
|
|
|
{
|
|
|
|
vol.Optional(CONF_ADDRESS): cv.positive_int,
|
|
|
|
vol.Optional(CONF_INPUT_TYPE): vol.In(
|
|
|
|
[
|
|
|
|
CALL_TYPE_REGISTER_HOLDING,
|
|
|
|
CALL_TYPE_DISCRETE,
|
|
|
|
CALL_TYPE_REGISTER_INPUT,
|
|
|
|
CALL_TYPE_COIL,
|
|
|
|
]
|
|
|
|
),
|
|
|
|
vol.Optional(CONF_STATE_OFF): cv.positive_int,
|
|
|
|
vol.Optional(CONF_STATE_ON): cv.positive_int,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2021-05-21 07:56:47 +00:00
|
|
|
FAN_SCHEMA = BASE_COMPONENT_SCHEMA.extend(
|
|
|
|
{
|
|
|
|
vol.Required(CONF_ADDRESS): cv.positive_int,
|
|
|
|
vol.Optional(CONF_WRITE_TYPE, default=CALL_TYPE_REGISTER_HOLDING): vol.In(
|
|
|
|
[CALL_TYPE_REGISTER_HOLDING, CALL_TYPE_COIL]
|
|
|
|
),
|
|
|
|
vol.Optional(CONF_COMMAND_OFF, default=0x00): cv.positive_int,
|
|
|
|
vol.Optional(CONF_COMMAND_ON, default=0x01): cv.positive_int,
|
|
|
|
vol.Optional(CONF_VERIFY): vol.Maybe(
|
|
|
|
{
|
|
|
|
vol.Optional(CONF_ADDRESS): cv.positive_int,
|
|
|
|
vol.Optional(CONF_INPUT_TYPE): vol.In(
|
|
|
|
[
|
|
|
|
CALL_TYPE_REGISTER_HOLDING,
|
|
|
|
CALL_TYPE_DISCRETE,
|
|
|
|
CALL_TYPE_REGISTER_INPUT,
|
|
|
|
CALL_TYPE_COIL,
|
|
|
|
]
|
|
|
|
),
|
|
|
|
vol.Optional(CONF_STATE_OFF): cv.positive_int,
|
|
|
|
vol.Optional(CONF_STATE_ON): cv.positive_int,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2021-03-27 21:48:06 +00:00
|
|
|
SENSOR_SCHEMA = BASE_COMPONENT_SCHEMA.extend(
|
|
|
|
{
|
|
|
|
vol.Required(CONF_ADDRESS): cv.positive_int,
|
|
|
|
vol.Optional(CONF_COUNT, default=1): cv.positive_int,
|
|
|
|
vol.Optional(CONF_DATA_TYPE, default=DATA_TYPE_INT): vol.In(
|
|
|
|
[
|
|
|
|
DATA_TYPE_INT,
|
|
|
|
DATA_TYPE_UINT,
|
|
|
|
DATA_TYPE_FLOAT,
|
|
|
|
DATA_TYPE_STRING,
|
|
|
|
DATA_TYPE_CUSTOM,
|
|
|
|
]
|
|
|
|
),
|
|
|
|
vol.Optional(CONF_DEVICE_CLASS): SENSOR_DEVICE_CLASSES_SCHEMA,
|
|
|
|
vol.Optional(CONF_OFFSET, default=0): number,
|
|
|
|
vol.Optional(CONF_PRECISION, default=0): cv.positive_int,
|
|
|
|
vol.Optional(CONF_INPUT_TYPE, default=CALL_TYPE_REGISTER_HOLDING): vol.In(
|
|
|
|
[CALL_TYPE_REGISTER_HOLDING, CALL_TYPE_REGISTER_INPUT]
|
|
|
|
),
|
2021-04-27 08:49:41 +00:00
|
|
|
vol.Optional(CONF_REVERSE_ORDER): cv.boolean,
|
|
|
|
vol.Optional(CONF_SWAP, default=CONF_SWAP_NONE): vol.In(
|
|
|
|
[CONF_SWAP_NONE, CONF_SWAP_BYTE, CONF_SWAP_WORD, CONF_SWAP_WORD_BYTE]
|
|
|
|
),
|
2021-03-27 21:48:06 +00:00
|
|
|
vol.Optional(CONF_SCALE, default=1): number,
|
|
|
|
vol.Optional(CONF_STRUCTURE): cv.string,
|
|
|
|
vol.Optional(CONF_UNIT_OF_MEASUREMENT): cv.string,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
BINARY_SENSOR_SCHEMA = BASE_COMPONENT_SCHEMA.extend(
|
|
|
|
{
|
|
|
|
vol.Required(CONF_ADDRESS): cv.positive_int,
|
|
|
|
vol.Optional(CONF_DEVICE_CLASS): BINARY_SENSOR_DEVICE_CLASSES_SCHEMA,
|
|
|
|
vol.Optional(CONF_INPUT_TYPE, default=CALL_TYPE_COIL): vol.In(
|
|
|
|
[CALL_TYPE_COIL, CALL_TYPE_DISCRETE]
|
|
|
|
),
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
MODBUS_SCHEMA = vol.Schema(
|
|
|
|
{
|
|
|
|
vol.Optional(CONF_NAME, default=DEFAULT_HUB): cv.string,
|
|
|
|
vol.Optional(CONF_TIMEOUT, default=3): cv.socket_timeout,
|
2021-05-14 08:54:23 +00:00
|
|
|
vol.Optional(CONF_CLOSE_COMM_ON_ERROR, default=True): cv.boolean,
|
2021-03-27 21:48:06 +00:00
|
|
|
vol.Optional(CONF_DELAY, default=0): cv.positive_int,
|
|
|
|
vol.Optional(CONF_BINARY_SENSORS): vol.All(
|
|
|
|
cv.ensure_list, [BINARY_SENSOR_SCHEMA]
|
|
|
|
),
|
|
|
|
vol.Optional(CONF_CLIMATES): vol.All(cv.ensure_list, [CLIMATE_SCHEMA]),
|
|
|
|
vol.Optional(CONF_COVERS): vol.All(cv.ensure_list, [COVERS_SCHEMA]),
|
2021-05-21 06:57:17 +00:00
|
|
|
vol.Optional(CONF_LIGHTS): vol.All(cv.ensure_list, [LIGHT_SCHEMA]),
|
2021-05-26 17:28:14 +00:00
|
|
|
vol.Optional(CONF_SENSORS): vol.All(
|
|
|
|
cv.ensure_list, [vol.All(SENSOR_SCHEMA, sensor_schema_validator)]
|
|
|
|
),
|
2021-03-27 21:48:06 +00:00
|
|
|
vol.Optional(CONF_SWITCHES): vol.All(cv.ensure_list, [SWITCH_SCHEMA]),
|
2021-05-21 07:56:47 +00:00
|
|
|
vol.Optional(CONF_FANS): vol.All(cv.ensure_list, [FAN_SCHEMA]),
|
2021-03-27 21:48:06 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
SERIAL_SCHEMA = MODBUS_SCHEMA.extend(
|
2019-07-31 19:25:30 +00:00
|
|
|
{
|
2021-03-27 21:48:06 +00:00
|
|
|
vol.Required(CONF_TYPE): "serial",
|
2019-07-31 19:25:30 +00:00
|
|
|
vol.Required(CONF_BAUDRATE): cv.positive_int,
|
|
|
|
vol.Required(CONF_BYTESIZE): vol.Any(5, 6, 7, 8),
|
|
|
|
vol.Required(CONF_METHOD): vol.Any("rtu", "ascii"),
|
|
|
|
vol.Required(CONF_PORT): cv.string,
|
|
|
|
vol.Required(CONF_PARITY): vol.Any("E", "O", "N"),
|
|
|
|
vol.Required(CONF_STOPBITS): vol.Any(1, 2),
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2021-03-27 21:48:06 +00:00
|
|
|
ETHERNET_SCHEMA = MODBUS_SCHEMA.extend(
|
2019-07-31 19:25:30 +00:00
|
|
|
{
|
|
|
|
vol.Required(CONF_HOST): cv.string,
|
|
|
|
vol.Required(CONF_PORT): cv.port,
|
|
|
|
vol.Required(CONF_TYPE): vol.Any("tcp", "udp", "rtuovertcp"),
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2021-03-27 21:48:06 +00:00
|
|
|
CONFIG_SCHEMA = vol.Schema(
|
|
|
|
{
|
|
|
|
DOMAIN: vol.All(
|
|
|
|
cv.ensure_list,
|
2021-05-10 17:28:38 +00:00
|
|
|
control_scan_interval,
|
2021-03-27 21:48:06 +00:00
|
|
|
[
|
|
|
|
vol.Any(SERIAL_SCHEMA, ETHERNET_SCHEMA),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
},
|
|
|
|
extra=vol.ALLOW_EXTRA,
|
|
|
|
)
|
|
|
|
|
2019-07-31 19:25:30 +00:00
|
|
|
SERVICE_WRITE_REGISTER_SCHEMA = vol.Schema(
|
|
|
|
{
|
|
|
|
vol.Optional(ATTR_HUB, default=DEFAULT_HUB): cv.string,
|
|
|
|
vol.Required(ATTR_UNIT): cv.positive_int,
|
|
|
|
vol.Required(ATTR_ADDRESS): cv.positive_int,
|
|
|
|
vol.Required(ATTR_VALUE): vol.Any(
|
|
|
|
cv.positive_int, vol.All(cv.ensure_list, [cv.positive_int])
|
|
|
|
),
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
SERVICE_WRITE_COIL_SCHEMA = vol.Schema(
|
|
|
|
{
|
|
|
|
vol.Optional(ATTR_HUB, default=DEFAULT_HUB): cv.string,
|
|
|
|
vol.Required(ATTR_UNIT): cv.positive_int,
|
|
|
|
vol.Required(ATTR_ADDRESS): cv.positive_int,
|
2021-04-03 11:15:01 +00:00
|
|
|
vol.Required(ATTR_STATE): vol.Any(
|
|
|
|
cv.boolean, vol.All(cv.ensure_list, [cv.boolean])
|
|
|
|
),
|
2019-07-31 19:25:30 +00:00
|
|
|
}
|
|
|
|
)
|
2016-09-13 20:47:44 +00:00
|
|
|
|
2015-04-15 14:47:42 +00:00
|
|
|
|
2021-05-15 17:54:17 +00:00
|
|
|
async def async_setup(hass, config):
|
2019-02-11 19:00:37 +00:00
|
|
|
"""Set up Modbus component."""
|
2021-05-15 17:54:17 +00:00
|
|
|
return await async_modbus_setup(
|
2021-02-12 15:33:18 +00:00
|
|
|
hass, config, SERVICE_WRITE_REGISTER_SCHEMA, SERVICE_WRITE_COIL_SCHEMA
|
2020-04-09 11:53:23 +00:00
|
|
|
)
|