Growcube commands

GrowcubeCommand inherited classes are used to send commands to the Growcube.

class growcube_client.growcubecommand.ClosePumpCommand(channel: Channel)

Bases: GrowcubeCommand

Command 46 - Close pump command This deletes any pump releated settings for the given channel

class growcube_client.growcubecommand.GrowcubeCommand(command: str, message: str)

Bases: object

Growcube command base class

CHD_HEAD = 'elea'
CMD_CLOSE_PUMP = '46'
CMD_PLANT_END = '45'
CMD_REQ_CURVE_DATA = '48'
CMD_REQ_WATER = '47'
CMD_SET_WORK_MODE = '43'
CMD_SYNC_TIME = '44'
CMD_WATER_MODE = '49'
CMD_WIFI_SETTINGS = '50'
Command = {'43': 'SetWorkModeCmd', '44': 'SyncTimeCmd', '45': 'PlantEndCmd', '46': 'ClosePumpCmd', '47': 'ReqWaterCmd', '48': 'ReqCurveDataCmd', '49': 'WaterModeCmd', '50': 'WifiSettingsCmd', 'ele502': 'SyncWaterLevelCmd', 'ele503': 'SyncWaterTimeCmd', 'ele504': 'DeviceUpgradeCmd', 'ele505': 'FactoryResetCmd'}
MSG_DEVICE_UPGRADE = 'ele504'
MSG_FACTORY_RESET = 'ele505'
MSG_SYNC_WATER_LEVEL = 'ele502'
MSG_SYNC_WATER_TIME = 'ele503'
get_description() str

Get a human readable description of the command Returns:

A human readable description of the command

get_message() str

Get the complete message for sending to the Growcube device Returns:

The complete message

class growcube_client.growcubecommand.PlantEndCommand(channel: Channel)

Bases: GrowcubeCommand

Command 45 - Plant end command This deletes any existing curve data for the given channel

class growcube_client.growcubecommand.RequestCurveDataCommand(channel: Channel)

Bases: GrowcubeCommand

Command 48 - Request curve data command This requests the moisture data for the given channel, used in the app to construct a graph

class growcube_client.growcubecommand.SetWorkModeCommand(mode: int)

Bases: GrowcubeCommand

Command 43 - Set work mode command No idea what this does, always sent as the first package from the phone app.

get_description() str

Get a human readable description of the command Returns:

A human readable description of the command

class growcube_client.growcubecommand.SyncDeviceUpgradeCommand

Bases: GrowcubeCommand

Command 504 - Device upgrade Issues a device upgrade request

class growcube_client.growcubecommand.SyncTimeCommand(timestamp: <module 'datetime' from '/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/datetime.py'>)

Bases: GrowcubeCommand

Command 44 - Sync time command

class growcube_client.growcubecommand.SyncWFactoryResetCommand

Bases: GrowcubeCommand

Command 505 - Factory reset Issues a factory reset request

class growcube_client.growcubecommand.SyncWaterLevelCommand

Bases: GrowcubeCommand

Command 502 - Sync water level No idea what this does

class growcube_client.growcubecommand.SyncWaterTimeCommand

Bases: GrowcubeCommand

Command 503 - Sync water time No idea what this does

class growcube_client.growcubecommand.WaterCommand(channel: Channel, state: bool)

Bases: GrowcubeCommand

Command 47 - Water command This starts or stops watering on the given channel

get_description() str

Get a human readable description of the command Returns:

A human readable description of the command

class growcube_client.growcubecommand.WateringModeCommand(channel: Channel, watering_mode: WateringMode, min_value: int, max_value: int)

Bases: GrowcubeCommand

Command 49 - Water mode command This sets the watering mode for the given channel

class growcube_client.growcubecommand.WiFiSettingsCommand(ssid: str, password: str)

Bases: GrowcubeCommand

Command 50 - WiFi settings command This setups the WiFi settings for the Growcube