Growcube discovery

The GrowcubeDiscovery class is used to discover Growcube devices on a network.

class growcube_client.growcubediscovery.GrowcubeDiscovery(log_level: int = 20)

Bases: object

Class for discovering Growcube devices on the network.

Variables:
  • PORT (int) – The default port for Growcube device discovery.

  • log_level – The logging level.

  • _devices – A list to store discovered devices.

PORT = 8800
async discover_device(ip_address: str) bool

Attempt to discover a Growcube device at the specified IP address.

Parameters:

ip_address (str) – The IP address to check.

Returns:

True if the device is discovered, False otherwise.

Return type:

bool

async discover_devices_in_local_subnet(subnet: IPv4Network = None) list[str]

Discover Growcube devices in the local subnet.

Parameters:

subnet (ipaddress.IPv4Network) – The local subnet to scan.

Returns:

A list of discovered device IP addresses.

Return type:

list[str]

static guess_subnet() IPv4Network

Guess the local subnet based on the local IP address We just assume a /24 network as that is true in 99,999% of the cases

Returns:

The local subnet

Return type:

ipaddress.IPv4Network