Skip to content

Solve bytes return in base.py #1985

@janiversen

Description

@janiversen

Reminder for myself,

This should be changed to None or an empty ModbusResponse
line 163-165 in base.py

if self.broadcast_enable and not request.slave_id:
resp = b"Broadcast write sent - no response expected"
break
these are the lines in async_execute which cause there to be a bytes return
i declared async_execute as returning ModbusResponse to allow type: ignore to work on the return type. Otherwise mypy would complain a lot about this. I do not know why this code was accepted in the first place

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions