Growcube report

GrowcubeReport inherited classes are used to receive commands from the Growcube.

class growcube_client.growcubereport.AutoWaterGrowcubeReport(data: str)

Bases: GrowcubeReport

Response 23 - AutoWater

Reports a historic watering event.

Variables:
  • _channel – Channel number 0-3.

  • _year – Year.

  • _month – Month.

  • _day – Day of month.

  • _hour – Hour.

  • _minute – Minute.

Parameters:

data (str) – Response data.

property channel: Channel

Channel number 0-3

Returns:

Channel number 0-3.

Return type:

int

property day: int

Day of month

Returns:

Day of month.

Return type:

int

get_description() str

Get a human-readable description of the report

Returns:

A human-readable description of the report.

Return type:

str

property hour: int

Hour

Returns:

Hour.

Return type:

int

property minute: int

Minute

Returns:

Minute.

Return type:

int

property month: int

Month

Returns:

Month.

Return type:

int

property timestamp: datetime

Timestamp

Returns:

Timestamp.

Return type:

datetime

property year: int

Year

Returns:

Year.

Return type:

int

class growcube_client.growcubereport.CheckOutletBlockedGrowcubeReport(data)

Bases: GrowcubeReport

Response 29 - Pump channel blocked Reports that a pump channel is blocked

Variables:

_channel – Channel number 0-3

property channel: Channel

Channel

Returns:

Channel number 0-3

Return type:

Channel

get_description() str

Get a human-readable description of the report

Returns:

A human-readable description of the report

Return type:

str

class growcube_client.growcubereport.CheckOutletLockedGrowcubeReport(data)

Bases: GrowcubeReport

Response 34 - ReqCheckSenSorLock Lock state of the sensor, triggered by a sensor fault.

Variables:

_channel – Channel number 0-3

property channel: Channel

Channel number 0-3

Returns:

Channel number 0-3

Return type:

Channel

get_description() str

Get a human-readable description of the report

Returns:

A human-readable description of the report

Return type:

str

class growcube_client.growcubereport.CheckSensorGrowcubeReport(data)

Bases: GrowcubeReport

Response 28 - RepCheckSenSorNotConnected Reports that a sensor is malfunctioning

Variables:

_channel – Channel number 0-3

property channel: Channel

Channel

Returns:

Channel number 0-3

Return type:

int

get_description() str

Get a human-readable description of the report

Returns:

A human-readable description of the report

Return type:

str

class growcube_client.growcubereport.CheckSensorNotConnectedGrowcubeReport(data)

Bases: GrowcubeReport

Response 30 - RepCheckSenSorNotConnect Reports that a sensor is not connected

Variables:

_channel – Channel number 0-3

property channel: Channel

State

Returns:

Channel number 0-3

Return type:

Channel

get_description() str

Get a human-readable description of the report

Returns:

A human-readable description of the report

Return type:

str

class growcube_client.growcubereport.CheckWifiStateGrowcubeReport(data)

Bases: GrowcubeReport

Response 31 - RepWifistate Reports WiFi state, probably only valid when in AP mode, to check if the new WiFi SSID is available

Variables:

_state – State

get_description() str

Get a human-readable description of the report

Returns:

A human-readable description of the report

Return type:

str

property state: bool

State

Returns:

True if state, otherwise False

Return type:

bool

class growcube_client.growcubereport.DeviceVersionGrowcubeReport(data: str)

Bases: GrowcubeReport

Response 24 - RepDeviceVersion Reports firmware version and device ID.

Variables:
  • _version – Firmware version.

  • _device_id – Device ID.

property device_id: str

Device ID

Returns:

Device ID.

Return type:

str

get_description() str

Get a human-readable description of the report

Returns:

A human-readable description of the report.

Return type:

str

property version: str

Firmware version

Returns:

Firmware version.

Return type:

str

class growcube_client.growcubereport.EraseDataGrowcubeReport(data: str)

Bases: GrowcubeReport

Response 25 - RepErasureData

Reports the success of data erasure.

Variables:

_success – Indicates whether the data erasure was successful.

get_description() str

Get a human-readable description of the report

Returns:

A human-readable description of the report.

Return type:

str

property success: bool

Success

Returns:

True if success, otherwise False.

Return type:

bool

class growcube_client.growcubereport.GrowCubeIPGrowcubeReport(data: str)

Bases: GrowcubeReport

Response 32 - RepGrowCubeIP Reports the IP address of the Growcube. This report is likely sent by the device after a network configuration change or during the initial connection process. It provides the current IP address assigned to the device.

Variables:

_ip – IP address

get_description() str

Get a human-readable description of the report

Returns:

A human-readable description of the report

Return type:

str

property ip: str

IP address

Returns:

IP address

Return type:

str

class growcube_client.growcubereport.GrowcubeReport(command: int)

Bases: object

Growcube report base class

Variables:
  • Response (dict[int, str]) – A dictionary mapping command values to corresponding report names.

  • CMD_INNER (str) – The inner command delimiter.

  • _command – The report command.

CMD_INNER = '@'
Response = {20: 'RepWaterStateCmd', 21: 'RepSTHSateCmd', 22: 'RepCurveCmd', 23: 'RepAutoWaterCmd', 24: 'RepDeviceVersionCmd', 25: 'RepErasureDataCmd', 26: 'RepPumpOpenCmd', 27: 'RepPumpCloseCmd', 28: 'RepCheckSenSorCmd', 29: 'RepCheckDuZhuanCmd', 30: 'RepCheckSenSorNotConnectCmd', 31: 'RepWifistateCmd', 32: 'RepGrowCubeIPCmd', 33: 'RepLockstateCmd', 34: 'ReqCheckSenSorLockCmd', 35: 'RepCurveEndFlagCmd'}
property command: str

Command value

Returns:

Command value.

Return type:

str

get_description() str

Get a human-readable description of the report

Returns:

A human-readable description of the report.

Return type:

str

static get_report(message) GrowcubeReport | None

Create a report from a message

Parameters:

message (GrowcubeMessage) – The message to create a report from.

Returns:

A GrowcubeReport child class instance.

Return type:

GrowcubeReport or None

class growcube_client.growcubereport.LockStateGrowcubeReport(data)

Bases: GrowcubeReport

Response 33 - RepLockstate Reports if the device is in locked state, as indicated by the red LED on the device

Variables:

_lock_state – Lock state

get_description() str

Get a human-readable description of the report

Returns:

A human-readable description of the report

Return type:

str

property lock_state: bool

Lock state

Returns:

True if locked, otherwise False

Return type:

bool

class growcube_client.growcubereport.MoistureHumidityStateGrowcubeReport(data: str)

Bases: GrowcubeReport

Response 21 - RepSTHSate

Report moisture, humidity, and temperature for a channel.

Variables:
  • _channel – Channel number 0-3.

  • _moisture – Moisture value.

  • _humidity – Humidity value.

  • _temperature – Temperature value.

property channel: Channel

Channel number 0-3

Returns:

Channel number 0-3.

Return type:

int

get_description() str

Get a human-readable description of the report

Returns:

A human-readable description of the report.

Return type:

str

property humidity: int

Humidity value

Returns:

Humidity value, %

Return type:

int

property moisture: int

Moisture value

Returns:

Moisture value, %

Return type:

int

property temperature: int

Temperature value

Returns:

Temperature value, °C

Return type:

int

class growcube_client.growcubereport.PumpCloseGrowcubeReport(data)

Bases: GrowcubeReport

Response 27 - RepPumpClose Reports that a pump has been stopped

Variables:

_channel – Channel number 0-3

property channel: Channel

channel number 0-3

Returns:

Channel number 0-3

Return type:

int

get_description() str

Get a human-readable description of the report

Returns:

A human-readable description of the report

Return type:

str

class growcube_client.growcubereport.PumpOpenGrowcubeReport(data)

Bases: GrowcubeReport

Response 26 - RepPumpOpen

Reports that a pump has been started

Variables:

_channel – Channel number 0-3

property channel: Channel

Channel number 0-3

Returns:

Channel number 0-3

Return type:

Channel

get_description() str

Get a human-readable description of the report

Returns:

A human-readable description of the report

Return type:

str

class growcube_client.growcubereport.RepCurveEndFlagGrowcubeReport(data)

Bases: GrowcubeReport

Response 35 - RepCurveEndFlag Reports the end of the water event reports stream

Variables:

_channel – Channel number 0-3

property channel: Channel

Channel number 0-3

Returns:

Channel number 0-3

Return type:

Channel

get_description() str

Get a human-readable description of the report

Returns:

A human-readable description of the report

Return type:

str

class growcube_client.growcubereport.UnknownGrowcubeReport

Bases: GrowcubeReport

Reports an unknown response

get_description() str

Get a human-readable description of the report

Returns:

A human-readable description of the report

Return type:

str

class growcube_client.growcubereport.WaterStateGrowcubeReport(data)

Bases: GrowcubeReport

Response 20 - RepWaterState

Reports water low state.

Variables:

_water_warning – Flag indicating water warning.

get_description() str

Get a human-readable description of the report

Returns:

A human-readable description of the report.

Return type:

str

property water_warning: bool

Water warning

Returns:

True if water warning, otherwise False.

Return type:

bool