Skip to content
Merged
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
7 changes: 2 additions & 5 deletions pymodbus/simulator/simdata.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Simulator data model classes."""
from __future__ import annotations

import asyncio
import inspect
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from typing import TypeAlias, cast
Expand Down Expand Up @@ -140,7 +140,7 @@ def __check_simple(self):
raise TypeError("1 <= address + count < 65536")
if not isinstance(self.datatype, DataType):
raise TypeError("datatype= must by an DataType")
if self.action and not (callable(self.action) and asyncio.iscoroutinefunction(self.action)):
if self.action and not (callable(self.action) and inspect.iscoroutinefunction(self.action)):
raise TypeError("action= not a async function")
if self.register_count != -1:
raise TypeError("register_count= is illegal")
Expand All @@ -166,6 +166,3 @@ def __post_init__(self):
raise TypeError(f"value= can only contain {x_datatype!s}")
super().__setattr__("register_count", self.count * x_len)
super().__setattr__("type_size", x_len)