Skip to content

Commit 26ec28e

Browse files
authored
Merge pull request #615 from amckenny/docs-update
docs: Build out HACS installation instructions
2 parents 27ca121 + 1fcf259 commit 26ec28e

File tree

4 files changed

+160
-147
lines changed

4 files changed

+160
-147
lines changed

docs/installation.rst

+17-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
Installation
22
============
33

4-
Option 1: HACS
4+
Option 1: Home Assistant Community Store (HACS)
55
--------------
66

7-
Under HACS -> Integrations, select “+”, search for ``pyscript`` and
8-
install it.
7+
HACS is an integration in Home Assistant that allows you to
8+
install custom integrations, frontend elements, and add-ons
9+
developed by the Home Assistant community without the need
10+
to manually download and copy files. To install HACS, follow
11+
the instructions on the
12+
`HACS website <https://hacs.xyz/docs/setup/prerequisites/>`__.
13+
14+
With HACS installed, under HACS -> Integrations, select “+”,
15+
search for ``pyscript``, and install it.
16+
17+
During installation you will be asked to identify whether to
18+
allow all imports and whether to allow access to HASS as a
19+
global variable. These settings are documented on the
20+
`overview <https://github.com/custom-components/pyscript/blob/master/docs/overview.rst>`__
21+
page and can be changed after installation in the integration
22+
configuration.
923

1024
Option 2: Manual
1125
----------------

docs/overview.rst

+12-12
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@ callable as Python functions, so it's easy and concise to implement
88
logic.
99

1010
Functions you write can be configured to be called as a service or run
11-
upon time, state-change or event triggers. Functions can also call any
12-
service, fire events and set state variables. Functions can sleep or
11+
upon time, state-change, or event triggers. Functions can also call any
12+
service, fire events, and set state variables. Functions can sleep or
1313
wait for additional changes in state variables or events, without
1414
slowing or affecting other operations. You can think of these functions
1515
as small programs that run in parallel, independently of each other, and
1616
they could be active for extended periods of time.
1717

18-
State, event and time triggers are specified by Python function
18+
State, event, and time triggers are specified by Python function
1919
decorators (the "@" lines immediately before each function definition).
2020
A state trigger can be any Python expression using state variables - the
2121
trigger is evaluated only when a state variable it references changes,
2222
and the trigger occurs when the expression is true or non-zero. A time
23-
trigger could be a single event (eg: date and time), a repetitive event
24-
(eg: at a particular time each day or weekday, daily relative to sunrise
25-
or sunset or any regular time period within an optional range) or using
23+
trigger could be a single event (e.g., date and time), a repetitive event
24+
(e.g., at a particular time each day or weekday, daily relative to sunrise
25+
or sunset, or any regular time period within an optional range), or using
2626
cron syntax (where events occur periodically based on a concise
27-
specification of ranges of minutes, hours, days of week, days of month
27+
specification of ranges of minutes, hours, days of week, days of month,
2828
and months). An event trigger specifies the event type, and an optional
2929
Python trigger test based on the event data that runs the Python
3030
function if true.
3131

32-
Pyscript implements a Python interpreter using the ast parser output, in
32+
Pyscript implements a Python interpreter using the AST parser output, in
3333
a fully async manner. That allows several of the "magic" features to be
3434
implemented in a seamless Pythonic manner, such as binding of variables
3535
to states and functions to services. Pyscript supports imports, although
@@ -41,10 +41,10 @@ generators, ``yield``, and defining special class methods.
4141
Pyscript provides a handful of additional built-in functions that connect
4242
to HASS features, like logging, accessing state variables as strings
4343
(if you need to compute their names dynamically), running and managing
44-
tasks, sleeping and waiting for triggers.
44+
tasks, sleeping, and waiting for triggers.
4545

4646
Pyscript also provides a kernel that interfaces with the Jupyter
47-
front-ends (eg, notebook, console, lab and VSC). That allows you to develop
47+
front-ends (eg, notebook, console, lab, and VSC). That allows you to develop
4848
and test pyscript code interactively. Plus you can interact with much of
4949
HASS by looking at state variables, calling services etc, in a similar
5050
way to `HASS
@@ -59,11 +59,11 @@ which can be downloaded and run interactively in Jupyter notebook or VSC
5959
connected to your live HASS with pyscript.
6060

6161
Pyscript provides functionality that complements the existing
62-
automations, templates and triggers. Pyscript is most similar to
62+
automations, templates, and triggers. Pyscript is most similar to
6363
`AppDaemon <https://appdaemon.readthedocs.io/en/latest/>`__, and some
6464
similarities and differences are discussed in this `Wiki
6565
page <https://github.com/custom-components/pyscript/wiki/Comparing-Pyscript-to-AppDaemon>`__.
66-
Pyscript with Jupyter makes it extremely easy to learn, use and debug.
66+
Pyscript with Jupyter makes it extremely easy to learn, use, and debug.
6767
Pyscripts presents a simplified and more integrated binding for Python
6868
scripting than `Python
6969
Scripts <https://www.home-assistant.io/integrations/python_script>`__,

0 commit comments

Comments
 (0)