DoorOpenerPico

class DoorOpenerPico

Initialisation class, creates some kind of DoorOpenerPico instance.

__init__()

Instantiates either DoorOpenerPicoBase, DoorOpenerPicoWeb or DoorOpenerPicoNetwork.

  • Creates a DoorOpenerPicoBase instance (button functionality only) if a credentials or discovery payload conf file can’t be found.

  • Otherwise, creates a DoorOpenerPicoWeb (web server) instance if the button is held on startup.

  • Otherwise, creates a DoorOpenerPicoNetwork (Home assistant/MQTT) instance.

Methods

_get_conf(filename)

Loads and parses the given filename as JSON, wrapper around _get_conf().

Parameters:

filename (str) – The conf filename to parse.

Returns:

The parsed conf file, or None if the file can’t be found.

Return type:

dict or None

_print_debug(message)

Prints a given debug message to the console (including date/time if enabled), wrapper around print_debug().

Parameters:

message (str) – The message to print.