API¶
An Abode alarm Python library.
- exception jaraco.abode.AuthenticationException(error)¶
Bases:
Exception
Class to throw authentication exception.
- static best_message(response)¶
- classmethod raise_for(response)¶
- class jaraco.abode.Client(username=None, password=None, auto_login=False, get_devices=False, get_automations=False)¶
Bases:
object
Client to an Abode system.
- property default_mode¶
Get the default mode.
- property events¶
Get the event controller.
- get_alarm(area='1', refresh=False)¶
Shortcut method to get the alarm device.
- get_automation(automation_id, refresh=False)¶
Get a single automation.
- get_automations(refresh=False)¶
Get all automations.
- get_device(device_id, refresh=False)¶
Get a single device.
- get_devices(refresh=False, generic_type=None)¶
Get all devices from Abode.
- login(username=None, password=None, mfa_code=None)¶
Explicit Abode login.
- logout()¶
Explicit Abode logout.
- refresh()¶
Do a full refresh of all devices and automations.
- send_request(method, path, headers=None, data=None)¶
Send requests to Abode.
- set_default_mode(default_mode)¶
Set the default mode when alarms are turned ‘on’.
- set_setting(name, value, area='1')¶
Set an abode system setting to a given value.
- property uuid¶
Get the UUID.
- exception jaraco.abode.Exception(error)¶
Bases:
Exception
Class to throw general abode exception.
- property errcode¶
- property message¶
Representation of an automation configured in Abode.
- class jaraco.abode.automation.Automation(state, client)¶
Bases:
Stateful
Class for viewing and controlling automations.
- property automation_id¶
Get the id of the automation.
- property is_enabled¶
Return True if the automation is enabled.
- trigger()¶
Trigger the automation.
Command-line interface.
- class jaraco.abode.cli.Dispatcher(client, args)¶
Bases:
object
- change_system_mode()¶
- disable_automation()¶
- dispatch()¶
- enable_automation()¶
- lock()¶
- login()¶
- output_current_mode()¶
- output_json()¶
- print_all_automations()¶
- print_all_devices()¶
- print_specific_devices()¶
- save_camera_image()¶
- set_setting()¶
- start_device_change_listener()¶
- switch_off()¶
- switch_on()¶
- trigger_automation()¶
- trigger_image_capture()¶
- unlock()¶
- jaraco.abode.cli.build_parser()¶
Get parsed arguments.
>>> parser = build_parser()
- jaraco.abode.cli.enable_color()¶
- jaraco.abode.cli.main()¶
Execute command line helper.
- jaraco.abode.cli.setup_logging(log_level=logging.INFO)¶
Set up the logging.
An Abode alarm Python library.
- class jaraco.abode.client.Client(username=None, password=None, auto_login=False, get_devices=False, get_automations=False)¶
Bases:
object
Client to an Abode system.
- property default_mode¶
Get the default mode.
- property events¶
Get the event controller.
- get_alarm(area='1', refresh=False)¶
Shortcut method to get the alarm device.
- get_automation(automation_id, refresh=False)¶
Get a single automation.
- get_automations(refresh=False)¶
Get all automations.
- get_device(device_id, refresh=False)¶
Get a single device.
- get_devices(refresh=False, generic_type=None)¶
Get all devices from Abode.
- login(username=None, password=None, mfa_code=None)¶
Explicit Abode login.
- logout()¶
Explicit Abode logout.
- refresh()¶
Do a full refresh of all devices and automations.
- send_request(method, path, headers=None, data=None)¶
Send requests to Abode.
- set_default_mode(default_mode)¶
Set the default mode when alarms are turned ‘on’.
- set_setting(name, value, area='1')¶
Set an abode system setting to a given value.
- property uuid¶
Get the UUID.
Abode cloud push events.
- class jaraco.abode.event_controller.EventController(client, url=SOCKETIO_URL)¶
Bases:
object
Subscribes to events.
- add_connection_status_callback(unique_id, callback)¶
Register callback for Abode server connection status.
- add_device_callback(devices, callback)¶
Register a device callback.
- add_event_callback(event_groups, callback)¶
Register callback for a group of timeline events.
- add_timeline_callback(timeline_events, callback)¶
Register a callback for a specific timeline event.
- property connected¶
Get the Abode connection status.
- remove_all_device_callbacks(devices)¶
Unregister all callbacks for a device.
- remove_connection_status_callback(unique_id)¶
Unregister connection status callbacks.
- property socketio¶
Get the SocketIO instance.
- start()¶
Start a thread to handle Abode SocketIO notifications.
- stop()¶
Tell the subscription thread to terminate - will block.
- exception jaraco.abode.exceptions.AuthenticationException(error)¶
Bases:
Exception
Class to throw authentication exception.
- static best_message(response)¶
- classmethod raise_for(response)¶
- exception jaraco.abode.exceptions.Exception(error)¶
Bases:
Exception
Class to throw general abode exception.
- property errcode¶
- property message¶
- exception jaraco.abode.exceptions.SocketIOException(error)¶
Bases:
Exception
Class to throw SocketIO Error exception.
- class jaraco.abode.settings.Area¶
Bases:
Setting
- property data¶
- names = ['away_entry_delay', 'away_exit_delay', 'home_entry_delay', 'home_exit_delay']¶
- path = '/api/v1/areas'¶
- validate()¶
- class jaraco.abode.settings.Panel¶
Bases:
Setting
- property data¶
- names = ['ircamera_resolution_t', 'ircamera_gray_t', 'beeper_mute']¶
- path = '/api/v1/panel/setting'¶
- validate()¶
- class jaraco.abode.settings.Setting¶
Bases:
SimpleNamespace
- classmethod load(name, value, area)¶
- class jaraco.abode.settings.Siren¶
Bases:
Setting
- property data¶
- names = ['entry', 'tamper', 'confirm']¶
- path = '/api/v1/siren'¶
- validate()¶
- class jaraco.abode.settings.Sound¶
Bases:
Setting
- property data¶
- names = ['door_chime', 'warning_beep', 'entry_beep_away', 'exit_beep_away', 'entry_beep_home', 'exit_beep_home', 'confirm_snd', 'alarm_len', 'final_beep']¶
- path = '/api/v1/sounds'¶
- validate()¶
Small SocketIO client via Websockets.
- class jaraco.abode.socketio.BackoffIntervals¶
Bases:
object
>>> bi = BackoffIntervals() >>> intervals = list(itertools.islice(bi, 10)) >>> all( ... BackoffIntervals.min_wait <= interval <= BackoffIntervals.max_wait ... for interval in intervals) True
- diff = 25¶
- max_wait = 30¶
- min_wait = 5¶
- reset(*args)¶
- class jaraco.abode.socketio.EngineIO¶
Bases:
object
- codes = {'close': 1, 'message': 4, 'open': 0, 'ping': 2, 'pong': 3, 0: 'open', 1: 'close', 2: 'ping', 3: 'pong', 4: 'message'}¶
- class jaraco.abode.socketio.SocketIO(url, cookie=None, origin=None)¶
Bases:
object
Class for using websockets to talk to a SocketIO server.
- codes = {'connect': 0, 'disconnect': 1, 'error': 4, 'event': 2, 0: 'connect', 1: 'disconnect', 2: 'event', 4: 'error'}¶
- on(event_name, callback)¶
Register callback for a SocketIO event.
- set_cookie(cookie=None)¶
Set the Cookie header.
- set_origin(origin=None)¶
Set the Origin header.
- start()¶
Start a thread to handle SocketIO notifications.
- stop()¶
Tell the SocketIO thread to terminate.
- jaraco.abode.socketio.find_json_list(text)¶
>>> find_json_list('["foo",\n\t"bar"]') ['foo', 'bar'] >>> find_json_list('{"abc": ["123"]}') ['123'] >>> find_json_list('{"abc": null}') Traceback (most recent call last): ... ValueError: ... >>> find_json_list('some text string') Traceback (most recent call last): ... ValueError: ...