pyzenbo.modules.system module

class pyzenbo.modules.system.System(inter_comm)

Bases: object

get_ac_plug_status(sync=True, timeout=None)
Get current AC-plug status, the result is returned by

on_result_callback.

Parameters
  • sync – True if this command is blocking

  • timeout – maximum blocking time in second, None means infinity

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code

register_ac_plug_status(sync=True, timeout=None)

Register the AC-plug status callback, the result is returned by on_result_callback.

Parameters
  • sync – True if this command is blocking

  • timeout – maximum blocking time in second, None means infinity

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code

unregister_ac_plug_status(sync=True, timeout=None)

Unregister the AC-plug status callback.

Parameters
  • sync – True if this command is blocking

  • timeout – maximum blocking time in second, None means infinity

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code

get_battery_status(sync=True, timeout=None)

Get current battery status, the result is returned by on_result_callback.

Parameters
  • sync – True if this command is blocking

  • timeout – maximum blocking time in second, None means infinity

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code

register_battery_status(sync=True, timeout=None)

Register the battery status callback, the result is returned by on_result_callback.

Parameters
  • sync – True if this command is blocking

  • timeout – maximum blocking time in second, None means infinity

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code

unregister_battery_status(sync=True, timeout=None)

Unregister the battery status callback.

Parameters
  • sync – True if this command is blocking

  • timeout – maximum blocking time in second, None means infinity

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code

register_battery_status_event(operator, value, sync=True, timeout=None)

Register the battery status event callback, when battery level reach the condition that specified, the result is returned by on_result_callback.

Parameters
  • operator – comparison type with a threshold value. 0: = (Equal) 1: ≠ (Not Equal) 2: > (Greater Than) 3: ≥ (Greater Than or Equal To) 4: < (Less Than) 5: ≤ (Less Than or Equal To)

  • value – threshold value to compare sensor data

  • sync – True if this command is blocking

  • timeout – maximum blocking time in second, None means infinity

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code

unregister_battery_status_event(operator, value, sync=True, timeout=None)

Unregister the battery status event callback.

Parameters
  • operator – comparison type with a threshold value. 0: = (Equal) 1: ≠ (Not Equal) 2: > (Greater Than) 3: ≥ (Greater Than or Equal To) 4: < (Less Than) 5: ≤ (Less Than or Equal To)

  • value – threshold value to compare sensor data

  • sync – True if this command is blocking

  • timeout – maximum blocking time in second, None means infinity

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code

get_media_volume(sync=True, timeout=None)

Get current media volume level, the result is returned by on_result_callback.

Parameters
  • sync – True if this command is blocking

  • timeout – maximum blocking time in second, None means infinity

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code

set_media_volume(value, sync=True, timeout=None)

Set media volume level.

Parameters
  • value – value can be ‘UP’, ‘DOWN’ or decimal between 0 and 100

  • sync – True if this command is blocking

  • timeout – maximum blocking time in second, None means infinity

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code

get_tts_volume(sync=True, timeout=None)

Get current text to speech volume level, the result is returned by on_result_callback.

Parameters
  • sync – True if this command is blocking

  • timeout – maximum blocking time in second, None means infinity

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code

set_tts_volume(value, sync=True, timeout=None)

Set text to speech volume level.

Parameters
  • value – value can be ‘UP’, ‘DOWN’ or decimal between 0 and 100

  • sync – True if this command is blocking

  • timeout – maximum blocking time in second, None means infinity

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code

register_screen_touch_event(event_type, value, sync=True, timeout=None)

Register the screen touch event callback, the result is returned by on_result_callback.

Parameters
  • event_type – 0: All event type 1: finger touch 2: swipe up 3: swipe down 4: swipe left 5: swipe right

  • value – how many fingers touch the screen, decimal between 0 and 10

  • sync – True if this command is blocking

  • timeout – maximum blocking time in second, None means infinity

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code

unregister_screen_touch_event(event_type, value, sync=True, timeout=None)

Unregister the screen touch event callback.

Parameters
  • event_type – 0: All event type 1: finger touch 2: swipe up 3: swipe down 4: swipe left 5: swipe right

  • value – how many fingers touch the screen, decimal between 0 and 10

  • sync – True if this command is blocking

  • timeout – maximum blocking time in second, None means infinity

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code