Skip to content

Broaden networkController into a network-switch interaction class (follow-up to #217) #224

Description

@Ulrond

Problem/Opportunity

PR #217 adds a networkController (networkControlClass) with a single wake() (Wake-on-LAN) method. In review, @TB-1993 noted this class is the natural home for general network-switch interaction, not just wake:

I was thinking the networkController class would be where we would implement interacting with different network switches. So users could look up MAC addresses, IPs, enable/disable ports, firewalls etc.

WoL is kept as the first, focused capability so #217 can land; this issue tracks growing the seam.

Proposed Solution

Extend networkControlClass (device network: block) into a small facade over network/switch operations, dispatched by type: like the power modules, e.g.:

  • Reachability: isReachable() / waitForOnline(timeout) / waitForOffline() (pairs with wake(); deviceClass.pingTest() already offers ICMP).
  • Address discovery: getMacAddress() / getIpAddress() (ARP/neighbour table or DHCP lease).
  • Managed switch / port control: enable/disable a port, PoE toggle, VLAN; optionally firewall rules — driven by a switch-specific networkModules/ backend.

Each capability is optional per backend (a wol module only implements wake()), following the module-per-type pattern established by powerModules/.

Acceptance Criteria

  • networkControlClass exposes additional network verbs beyond wake(), each backed by a networkModules/ implementation selected by type.
  • Unsupported verbs degrade with a clear error rather than AttributeError.
  • At least one managed-switch backend and the reachability helpers are implemented with examples.

Additional Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions