-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
58 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
"""Handle Data attributes.""" | ||
from ipaddress import IPv4Address, IPv6Address, ip_address as convert_ip | ||
from typing import Union | ||
|
||
import attr | ||
|
||
|
||
@attr.s | ||
class Device: | ||
"""A single device.""" | ||
|
||
mac: str = attr.ib() | ||
hostname: str = attr.ib(cmp=False) | ||
ip: Union[IPv4Address, IPv6Address] = attr.ib(cmp=False, convert=convert_ip) | ||
|
||
|
||
@attr.s | ||
class DownstreamChannel: | ||
"""A locked downstream channel.""" | ||
|
||
frequency: int = attr.ib() | ||
powerLevel: int = attr.ib() | ||
modulation: str = attr.ib() | ||
id: str = attr.ib() | ||
snr: float = attr.ib() | ||
preRs: int = attr.ib() | ||
postRs: int = attr.ib() | ||
qamLocked: bool = attr.ib() | ||
fecLocked: bool = attr.ib() | ||
mpegLocked: bool = attr.ib() | ||
|
||
|
||
@attr.s | ||
class UpstreamChannel: | ||
"""A locked upstream channel.""" | ||
|
||
frequency: int = attr.ib() | ||
powerLevel: int = attr.ib() | ||
symbolRate: str = attr.ib() | ||
id: str = attr.ib() | ||
modulation: str = attr.ib() | ||
type: str = attr.ib() | ||
t1Timeouts: int = attr.ib() | ||
t2Timeouts: int = attr.ib() | ||
t3Timeouts: int = attr.ib() | ||
t4Timeouts: int = attr.ib() | ||
channelType: str = attr.ib() | ||
messageType: int = attr.ib() |