From 22a54c83c0684bc1132242d7d35c9ec13afb210c Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Mon, 13 Jul 2020 19:54:53 -0500 Subject: Add starter usage docs and remove using lirc on macos & windows --- docs/source/usage.rst | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'docs/source/usage.rst') diff --git a/docs/source/usage.rst b/docs/source/usage.rst index 9fa12ad..588d2f7 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -1,2 +1,38 @@ Usage -===== \ No newline at end of file +===== + +Once you've installed the ``lirc`` python package, there will be a number +of things you can now import from it to get started. + +.. code-block:: python + + from lirc import ( + Lirc, + LircResponse, + LircError, + LircSocketError, + LircSocketTimeoutError, + InvalidReplyPacketFormatError + ) + +The most relevant of these is ``Lirc``, since this is the main class +you will be using. + +Initializing Lirc +----------------- + +The ``Lirc`` class takes in three separate options, which all have default +values, that we may pass into it to construct it and override those default +values. + +The simplest way to construct ``Lirc`` is with no arguments at all. + +.. code-block:: python + + from lirc import Lirc + + lirc = Lirc() + +This will attempt to connect to the lircd socket at "/var/run/lirc/lircd" on +your system, create a socket using ``AF_UNIX`` and ``SOCK_STREAM``, and sets +a socket timeout of 5 seconds. \ No newline at end of file -- cgit v1.2.3