Skip to content
Merged
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
9 changes: 5 additions & 4 deletions pymodbus/datastore/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,17 @@ def __init__(self, *_args,
ir = ModbusSequentialDataBlock(0, values=0)
if not hr:
hr = ModbusSequentialDataBlock(0, values=0)
for entry in di.simdata:
entry.datatype = DataType.BITS
for entry in co.simdata:
entry.datatype = DataType.BITS
for entry in di.simdata:
entry.datatype = DataType.BITS
self.simdevice = SimDevice(0, simdata=(
di.simdata,
co.simdata,
di.simdata,
ir.simdata,
hr.simdata))
Log.warning("ModbusDeviceContext is deprecated "
Log.warning("ModbusDeviceContext, ModbusSequentialDataBlock, "
"ModbusSparseDataBlock are deprecated "
"and will be removed in v4.\n"
"Please convert to SimData/SimDevice.\n"
"Please read https://pymodbus.readthedocs.io/en/dev/source/upgrade_40.html#convert-to-simdata-simdevice")
Expand Down
5 changes: 0 additions & 5 deletions pymodbus/datastore/sequential.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Modbus Sequential Datastore."""
from __future__ import annotations

from ..logging import Log
from ..simulator.simdata import DataType, SimData


Expand All @@ -14,8 +13,4 @@ def __init__(self, address, values):
:param address: The starting address of the datastore
:param values: Either a list or a dictionary of values
"""
Log.warning("ModbusSequentialDataBlock is deprecated "
"and will be removed in v4.\n"
"Please convert to SimData/SimDevice.\n"
"Please read https://pymodbus.readthedocs.io/en/dev/source/upgrade_40.html#convert-to-simdata-simdevice")
self.simdata = [SimData(address, values=values, datatype=DataType.REGISTERS)]
5 changes: 0 additions & 5 deletions pymodbus/datastore/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from __future__ import annotations

from ..exceptions import ParameterException
from ..logging import Log
from ..simulator.simdata import DataType, SimData


Expand All @@ -14,10 +13,6 @@ def __init__(self, values=None, mutable=True):
_ = mutable
self.simdata: list[SimData] = []
self._process_values(values)
Log.warning("ModbusSparseDataBlock is deprecated "
"and will be removed in v4.\n"
"Please convert to SimData/SimDevice.\n"
"Please read https://pymodbus.readthedocs.io/en/dev/source/upgrade_40.html#convert-to-simdata-simdevice")

def _process_values(self, values):
"""Process values."""
Expand Down