Skip to content

Commit

Permalink
Merge pull request #27 from home-assistant/dev
Browse files Browse the repository at this point in the history
Release 0.19
  • Loading branch information
pvizeli authored May 2, 2017
2 parents 19dfdb0 + f178dde commit 0a1e6b3
Show file tree
Hide file tree
Showing 22 changed files with 319 additions and 208 deletions.
36 changes: 33 additions & 3 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ On success

- GET `/supervisor/info`

The addons from `addons` are only installed one.

```json
{
"version": "INSTALL_VERSION",
Expand All @@ -35,9 +37,9 @@ On success
{
"name": "xy bla",
"slug": "xy",
"version": "LAST_VERSION",
"installed": "none|INSTALL_VERSION",
"dedicated": "bool",
"version": "INSTALL_VERSION",
"last_version": "VERSION_FOR_UPDATE",
"detached": "bool",
"description": "description"
}
],
Expand All @@ -47,6 +49,34 @@ On success
}
```

- GET `/supervisor/addons`

Get all available addons

```json
{
"addons": [
{
"name": "xy bla",
"slug": "xy",
"repository": "12345678|null",
"version": "LAST_VERSION",
"installed": "none|INSTALL_VERSION",
"detached": "bool",
"description": "description"
}
],
"repositories": [
{
"slug": "12345678",
"name": "Repitory Name",
"url": "WEBSITE",
"maintainer": "BLA BLU <[email protected]>"
}
]
}
```

- POST `/supervisor/update`
Optional:
```json
Expand Down
34 changes: 4 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ First private cloud solution for home automation.

It is a docker image (supervisor) they manage HomeAssistant docker and give a interface to control itself over UI. It have a own eco system with addons to extend the functionality in a easy way.

![](misc/hassio.png?raw=true)

[HassIO-Addons](https://github.com/home-assistant/hassio-addons) | [HassIO-Build](https://github.com/home-assistant/hassio-build)

**HassIO is at the moment on development and not ready to use productive!**

## Feature in progress
- Backup/Restore
- MQTT addon
- DHCP-Server addon

# HomeAssistant
Expand All @@ -23,34 +24,7 @@ http:
ssl_key: /ssl/privkey.pem
```
# Hardware Image
The image is based on ResinOS and Yocto Linux. It comes with the HassIO supervisor pre-installed. This includes support to update the supervisor over the air. After flashing your host OS will not require any more maintenance! The image does not include Home Assistant, instead it will downloaded when the image boots up for the first time.
Download can be found here: https://drive.google.com/drive/folders/0B2o1Uz6l1wVNbFJnb2gwNXJja28?usp=sharing
After extracting the archive, flash it to a drive using [Etcher](https://etcher.io/).
## History
- **0.1**: First techpreview with dumy supervisor (ResinOS 2.0.0-RC5)
- **0.2**: Fix some bugs and update it to HassIO 0.2
- **0.3**: Update HostControl and feature for HassIO 0.3 (ResinOS 2.0.0 / need reflash)
- **0.4**: Update HostControl and bring resinos OTA (resinhub) back (ResinOS 2.0.0-rev3)
## Configuring the image
You can configure the WiFi network that the image should connect to after flashing using [`resin-device-toolbox`](https://resinos.io/docs/raspberrypi3/gettingstarted/#install-resin-device-toolbox).

## Developer access to ResinOS host
Create an `authorized_keys` file in the boot partition of your SD card with your public key. After a boot it, you can acces your device as root over ssh on port 22222.

## Troubleshooting

Read logoutput from supervisor:
```bash
journalctl -f -u resin-supervisor.service
docker logs homeassistant
```

## Install on a own System
We have a installer to install HassIO on own linux device without our hardware image:
https://github.com/home-assistant/hassio-build/tree/master/install
- Generic Linux installation: https://github.com/home-assistant/hassio-build/tree/master/install
- Hardware Images: https://github.com/home-assistant/hassio-build/blob/master/meta-hassio/
15 changes: 7 additions & 8 deletions hassio/addons/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Init file for HassIO addons."""
import asyncio
import logging
import os
import shutil

from .data import AddonsData
Expand Down Expand Up @@ -51,7 +50,7 @@ async def prepare(self, arch):
self.config, self.loop, self.dock, self, addon)
await self.dockers[addon].attach()

async def add_custom_repository(self, url):
async def add_git_repository(self, url):
"""Add a new custom repository."""
if url in self.config.addons_repositories:
_LOGGER.warning("Repository already exists %s", url)
Expand All @@ -67,7 +66,7 @@ async def add_custom_repository(self, url):
self.repositories.append(repo)
return True

def drop_custom_repository(self, url):
def drop_git_repository(self, url):
"""Remove a custom repository."""
for repo in self.repositories:
if repo.url == url:
Expand All @@ -91,7 +90,7 @@ async def reload(self):
self.merge_update_config()

# remove stalled addons
for addon in self.list_removed:
for addon in self.list_detached:
_LOGGER.warning("Dedicated addon '%s' found!", addon)

async def auto_boot(self, start_type):
Expand All @@ -113,10 +112,10 @@ async def install(self, addon, version=None):
_LOGGER.error("Addon %s is already installed", addon)
return False

if not os.path.isdir(self.path_data(addon)):
if not self.path_data(addon).is_dir():
_LOGGER.info("Create Home-Assistant addon data folder %s",
self.path_data(addon))
os.mkdir(self.path_data(addon))
self.path_data(addon).mkdir()

addon_docker = DockerAddon(
self.config, self.loop, self.dock, self, addon)
Expand All @@ -142,10 +141,10 @@ async def uninstall(self, addon):
if not await self.dockers[addon].remove():
return False

if os.path.isdir(self.path_data(addon)):
if self.path_data(addon).is_dir():
_LOGGER.info("Remove Home-Assistant addon data folder %s",
self.path_data(addon))
shutil.rmtree(self.path_data(addon))
shutil.rmtree(str(self.path_data(addon)))

self.dockers.pop(addon)
self.set_addon_uninstall(addon)
Expand Down
Loading

0 comments on commit 0a1e6b3

Please sign in to comment.