Archived
19 lines
414 B
Python
19 lines
414 B
Python
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass(slots=True)
|
|
class UpdateResult:
|
|
hostname: str
|
|
ipv4: str | None
|
|
ipv6: str | None
|
|
changed: bool
|
|
update_ipv4: bool = True
|
|
update_ipv6: bool = True
|
|
|
|
@property
|
|
def dyndns_response(self) -> str:
|
|
ip = self.ipv4 or self.ipv6 or "0.0.0.0"
|
|
return f"{'good' if self.changed else 'nochg'} {ip}"
|