Skip to content

Commit

Permalink
Fix typos (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabaff committed Feb 10, 2019
1 parent a0b971d commit c6397fc
Showing 1 changed file with 20 additions and 23 deletions.
43 changes: 20 additions & 23 deletions README.rst
Expand Up @@ -12,8 +12,8 @@ instance directly from the command-line.
:target: https://asciinema.org/a/216235?autoplay=1&speed=1


**Note**: This is still in alpha and under heavy development. Name and structure of
commands are expected to still change.
**Note**: This is still in alpha and under heavy development. Name and
structure of commands are expected to still change.

Installation
============
Expand All @@ -28,21 +28,21 @@ To use latest pre-release from ``dev`` branch:

.. code:: bash
$ pip install pip3 install git+https://github.com/home-assistant/home-assistant-cli@dev
$ pip install pip3 install git+https://github.com/home-assistant/home-assistant-cli@dev
To get started you'll need to have or generate a long lasting token format
on your Home Assistant profile page (i.e. https://localhost:8123/profile).

Then you can use ``--server`` and ``--token`` paremeter on each call,
or as is recommended setup ``HASS_SERVER`` and ``HASS_TOKEN`` environment variables.
Then you can use ``--server`` and ``--token`` paremeter on each call or as is
recommended setup ``HASS_SERVER`` and ``HASS_TOKEN`` environment variables.

.. code:: bash
$ export HASS_SERVER=https://hassio.local:8123
$ export HASS_TOKEN=<secret>
Once that is enabled and you are using either ``zsh`` or ``bash`` run
the folowing to enable autocompletion for hass-cli commands.
the following to enable autocompletion for ``hass-cli`` commands.

.. code:: bash
Expand All @@ -52,8 +52,8 @@ the folowing to enable autocompletion for hass-cli commands.
Usage
=====

Note: Below is listed **some** of the features, make sure to use ``--help`` and autocompletion to learn
more of the features as they become available.
Note: Below is listed **some** of the features, make sure to use ``--help`` and
autocompletion to learn more of the features as they become available.

Most commands returns a table version of what the Home Assistant API returns.
For example to get basic info about your Home Assistant server you use ``info``:
Expand All @@ -64,7 +64,7 @@ For example to get basic info about your Home Assistant server you use ``info``:
BASE_URL LOCATION REQUIRES_API_PASWORD VERSION
https://hassio.local:8123 Fort of Solitude False 0.86.2
If you prefer yaml you can use `--output=yaml`:
If you prefer yaml you can use ``--output=yaml``:

.. code:: bash
Expand Down Expand Up @@ -112,14 +112,14 @@ If you for example just wanted the name and all attributes you could do:

.. code:: bash
hass-cli --columns=ENTITY="entity_id,ATTRIBUTES=attributes[*]" entity list zone
$ hass-cli --columns=ENTITY="entity_id,ATTRIBUTES=attributes[*]" entity list zone
ENTITY ATTRIBUTES
zone.school {'friendly_name': 'School', 'hidden': True, 'icon': 'mdi:school', 'latitude': 7.011023, 'longitude': 16.858151, 'radius': 50.0}
zone.unnamed_zone {'friendly_name': 'Unnamed zone', 'hidden': True, 'icon': 'mdi:home', 'latitude': 37.006476, 'longitude': 2.861699, 'radius': 50.0}
zone.home {'friendly_name': 'Andersens', 'hidden': True, 'icon': 'mdi:home', 'latitude': 27.006476, 'longitude': 7.861699, 'radius': 100}
You can more details of an entity easily by using `yaml` or `json` output format. In this example we use the
shorthand of output: `-o`:
You can more details of an entity easily by using ``yaml`` or ``json`` output
format. In this example we use the shorthand of output: ``-o``:

.. code:: bash
Expand All @@ -140,17 +140,15 @@ You can edit state via an editor:
.. code:: bash
$ hass-cli entity edit light.guestroom_light
..
This will open the current state in your favorite editor and any changes you save will
be used for an update.

You can also explicitly create/edit via the `--json` flag:
You can also explicitly create/edit via the ``--json`` flag:

.. code:: bash
$ hass-cli entity edit sensor.test --json='{ "state":"off"}'
..
List possible services with or without a regular expression filter:

Expand All @@ -160,7 +158,7 @@ List possible services with or without a regular expression filter:
DOMAIN SERVICE DESCRIPTION
homeassistant toggle Generic service to toggle devices on/off...
For more details the yaml format is useful:
For more details the YAML format is useful:

.. code:: bash
Expand Down Expand Up @@ -290,7 +288,7 @@ specific area with id "eab9930..." or named "Cupboard".
Events
------

You can subscribe and watch all or a specific event type using `event watch`.
You can subscribe and watch all or a specific event type using ``event watch``.

.. code:: bash
Expand Down Expand Up @@ -342,22 +340,23 @@ Auto-completion
###############

As described above you can use ``source <(hass-cli completion zsh)`` to
quickly and easy enable auto completion. If you do it from your ``.bashrc`` or ``.zshrc``
its recommend to use the form below as that does not trigger a run of `hass-cli` itself.
quickly and easy enable auto completion. If you do it from your ``.bashrc``
or ``.zshrc`` it's recommend to use the form below as that does not trigger
a run of ``hass-cli`` itself.

For zsh:

.. code:: bash
eval "$(_HASS_CLI_COMPLETE=source_zsh hass-cli)"
..
For bash:

.. code:: bash
eval "$(_HASS_CLI_COMPLETE=source hass-cli)"
..
Once enabled there is autocompletion for commands and for certain attributes like entities:

Expand All @@ -371,7 +370,6 @@ Once enabled there is autocompletion for commands and for certain attributes lik
light.guestroom_light light.basement_light_stairs light.basement_light_2 light.hallroom_light_5 light.dinner_table_light_3 light.winter_garden_light_5
light.hallroom_light_3 light.basement_light_3 light.basement_light_8 light.dinner_table_light_2 light.winter_garden_light_1 light.kitchen_light_3
..
Note: For this to work you'll need to have setup the following environment variables if your home-assistant
is secured and not running on localhost:8123:
Expand All @@ -381,7 +379,6 @@ is secured and not running on localhost:8123:
export HASS_SERVER=https://hassio.local:8123
export HASS_TOKEN=<Bearer token from HASS_SERVER/profile>
..
Help
####
Expand Down

0 comments on commit c6397fc

Please sign in to comment.