Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ APPLY_FIXES: all # all, none, or list of linter keys
DISABLE:
- PYTHON
- COPYPASTE
- CSS
DISABLE_LINTERS:
- SPELL_CSPELL
SHOW_ELAPSED_TIME: true
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

[![Home Assistant Logo](https://github.com/GrandMoff100/HomeAssistantAPI/blob/7edb4e6298d37bda19c08b807613c6d351788491/docs/images/homeassistant-logo.png?raw=true)](https://home-assistant.io)

Python Wrapper for Homeassistant's [REST API](https://developers.home-assistant.io/docs/api/rest/)

## Python wrapper for Homeassistant's [REST API](https://developers.home-assistant.io/docs/api/rest/)

Please ⭐️ the repo if you find this project useful or cool!

Expand All @@ -26,10 +25,18 @@ with Client(

light.turn_on(entity_id='light.living_room_lamp')
```
All the methods also support async!

## Documentation
All documentation, API reference, Contribution guidelines and pretty much everything else you'd want to know is on our readthedocs site [here](https://homeassistantapi.readthedocs.io)
All documentation, API reference, contribution guidelines and pretty much everything else
you'd want to know is on our readthedocs site [here](https://homeassistantapi.readthedocs.io)

If there is something missing, open an issue and let us know! Thanks!

Go make some cool stuff! Maybe come back and tell us about it in a
[discussion](https://github.com/GrandMoff100/HomeAssistantAPI/discussions)?
We'd love to hear about how you use our library!!

If theres something missing open an issue and let us know! Thanks!
## License

Go make some cool stuff! Maybe come back and tell us about it in a [discussion](https://github.com/GrandMoff100/HomeAssistantAPI/discussions)? We'd love to hear about how you use our library!!
This project is under the GNU GPLv3 license, as defined by the Free Software Foundation.
8 changes: 5 additions & 3 deletions docs/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ Next run in your terminal.
Step Three: Installing Dependencies
======================================

Firstly, you need to have Python 3.7 or newer with Pip installed. Download the latest Python Version from `here <https://www.python.org/>`_.
Firstly, you need to have Python 3.7 or newer with Pip installed.
Download the latest Python Version from `here <https://www.python.org/>`__.
Then you need to install the very popular Python Package Manager, :code:`poetry`.
Checkout the `Poetry docs <https://python-poetry.org/docs/>`_.
You can install that with :code:`pip` by running :code:`pip install poetry`.
Expand All @@ -46,8 +47,9 @@ Step Four: [Optional] Setting Up a Home Assistant Development Environment.

If you do not have a Home Assistant installation running already, you can setup a Home Assistant Development environment.
Which is basically a local, unpackaged, Home Assistant Core installation, that runs with just Python (no Docker or Operating System).
You can start and stop the server really easily as it runs just in your terminal and gives you lots of control over it, making it ideal for testing your changes to Home Assistant API.
Follow this great guide `here <https://developers.home-assistant.io/docs/development_environment>`_ to do that.
You can start and stop the server really easily as it runs just in your
terminal and gives you lots of control over it, making it ideal for testing your changes to Home Assistant API.
Follow this great guide `here <https://developers.home-assistant.io/docs/development_environment>`__ to do that.
After that you are now ready to make your changes to the codebase!

Testing
Expand Down
27 changes: 27 additions & 0 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,30 @@ body {
.version {
color: #d9d9d9;
}

dt {
padding-left: 6px;
padding-right: 6px;
}

.sig {
border-radius: 0.3142em;
}

/* csslint ignore:start */
html.writer-html4 .rst-content dl:not(.docutils) > dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) > dt {
border: 1px solid #72cdf7;
}

html.writer-html4 .rst-content dl:not(.docutils) dl:not(.field-list) > dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl:not(.field-list) > dt {
border: 1px solid #adadad;
}

/* csslint ignore:end */

.py > .headerlink {
visibility: hidden !important;
position: absolute !important;
}
4 changes: 3 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ Index
Home <self>
quickstart
usage
development
api
CONTRIBUTING
Advanced <advanced>


Features
Expand Down
7 changes: 4 additions & 3 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Homeassistant
Before using this library, you need to have Home Assistant running on a device.
Something like a `Raspberry Pi 3 or 4 <https://www.raspberrypi.com>`_ or spare laptop.
If you don't want to do that you can setup a Home Assistant container on your laptop or desktop with docker.
See `here <https://www.home-assistant.io/installation/>`_ for how to install the installation right for you.
See `here <https://www.home-assistant.io/installation/>`__ for how to install the installation right for you.

Configuring the REST API Server in Homeassistant
=======================================================
Expand All @@ -31,11 +31,12 @@ If you are not sure if it is enabled or not, chances are if your frontend is ena
Access Token
--------------
Then once you have done that you need to head over to your profile and set up a "Long Lived Access Token" to use in your code later.
A good guide on how to do that is `here <https://www.home-assistant.io/docs/authentication/#your-account-profile>`_
A good guide on how to do that is `here <https://www.home-assistant.io/docs/authentication/#your-account-profile>`__

Exposing Home Assistant to the Web
--------------------------------------
You may want to setup remote access through a Dynamic DNS server like DuckDNS (a good youtube tutorial on how to do that `here <https://www.youtube.com/watch?v=AK5E2T5tWyM>`_, keep in mind you will need to port forward to set that up.)
You may want to setup remote access through a Dynamic DNS server like DuckDNS (a good youtube tutorial on how to do that
`here <https://www.youtube.com/watch?v=AK5E2T5tWyM>`__, keep in mind you will need to port forward to set that up.)
If you do pursue this your api url will be something like :code:`https://yourhomeassistant.duckdns.org:8123/api`.
Which is different than what it could have looked like before.
Which might have been something like :code:`http://homeassistant.local:8123/api` or :code:`http://localhost:8123/api`
Expand Down
8 changes: 2 additions & 6 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,5 @@ What's Next?

Browse below to learn more about what you can do with :code:`homeassistant_api`.


.. toctree::
:maxdepth: 2

api
advanced
* `API Reference <api.html>`_
* `Advanced Section <advanced.html>`_