Skip to content

Commit

Permalink
Fixup DutlinkSerial initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCao committed Jan 29, 2025
1 parent a53786e commit 89bfcc1
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,19 @@ def control(self, direction, ty, actions, action, value):


@dataclass(kw_only=True)
class DutlinkSerial(DutlinkConfig, PySerial):
url: str | None = field(init=False, default=None)

class DutlinkSerialConfig(DutlinkConfig, Driver):
def __post_init__(self):
if hasattr(super(), "__post_init__"):
super().__post_init__()

self.url = self.tty


@dataclass(kw_only=True)
class DutlinkSerial(PySerial, DutlinkSerialConfig):
url: str | None = field(init=False, default=None)


@dataclass(kw_only=True)
class DutlinkPower(DutlinkConfig, PowerInterface, Driver):
last_action: str | None = field(default=None)
Expand Down

0 comments on commit 89bfcc1

Please sign in to comment.