MCPcopy Create free account
hub / github.com/Tong89/smartNode / GeoRelay

Class GeoRelay

backend/models.py:34–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32
33@dataclass
34class GeoRelay:
35 id: str
36 name: str
37 lon: float
38 bandwidth: int = 2000
39 antenna: Optional[str] = None
40 beams: Optional[int] = None
41
42 @classmethod
43 def from_dict(cls, d: dict) -> "GeoRelay":
44 return cls(
45 id=d["id"], name=d["name"], lon=d.get("lon", 0),
46 bandwidth=d.get("bandwidth", 2000), antenna=d.get("antenna"), beams=d.get("beams"),
47 )
48
49 def to_dict(self) -> dict:
50 return {k: v for k, v in asdict(self).items() if v is not None}
51
52
53@dataclass

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected