Bladeren bron

Git config

pull/1/head
Ales Komarek 7 jaren geleden
bovenliggende
commit
572f94b3ba
6 gewijzigde bestanden met toevoegingen van 85 en 31 verwijderingen
  1. +24
    -6
      README.rst
  2. +3
    -1
      home_assistant/files/supervisor.conf
  3. +6
    -0
      home_assistant/map.jinja
  4. +26
    -1
      home_assistant/server.sls
  5. +26
    -0
      metadata/service/server/config/base.yml
  6. +0
    -23
      metadata/service/server/single.yml

+ 24
- 6
README.rst Bestand weergeven

@@ -1,9 +1,10 @@

==================================
Home Assistant
==================================
======================
Home Assistant formula
======================

Home Assistant is an open-source home automation platform running on Python 3. Track and control all devices at home and automate control.
Home Assistant is an open-source home automation platform running on Python 3.
Track and control all devices at home and automate control.
Sample pillars
==============
@@ -19,11 +20,28 @@ Single homeassistant service
address: 0.0.0.0
port: 8123

Read more
=========
home-assistant service wit git based configuration

.. code-block:: yaml

home_assistant:
server:
enabled: true
bind:
address: 0.0.0.0
port: 8123
config:
engine: git
address: '${_param:home_assistant_config_repository}'
branch: ${_param:home_assistant_config_revision}


More information
================

* https://home-assistant.io/getting-started/


Documentation and Bugs
======================


+ 3
- 1
home_assistant/files/supervisor.conf Bestand weergeven

@@ -1,3 +1,5 @@
{%- set service = salt['pillar.get']('supervisor:server:service:'+service_name) %}
{%- from "home_assistant/map.jinja" import server with context %}

[program:home_assistant_server]
command=/srv/home_assistant/bin/hass --config /etc/home_assistant/
@@ -11,4 +13,4 @@ redirect_stderr=true
stdout_logfile=/var/log/home_assistant/home_assistant.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
user=home_assistant
user={{ server.user }}

+ 6
- 0
home_assistant/map.jinja Bestand weergeven

@@ -5,8 +5,14 @@ Debian:
pkgs:
- python3-dev
- python3-pip
bind:
address: 0.0.0.0
port: 8123
dir:
base: /srv/home_assistant
config:
engine: local
user: home_assistant
{%- endload %}

{%- set server = salt['grains.filter_by'](base_defaults, merge=salt['pillar.get']('home_assistant:server')) %}

+ 26
- 1
home_assistant/server.sls Bestand weergeven

@@ -32,6 +32,29 @@ home_assistant_dir:
- require:
- virtualenv: {{ server.dir.base }}

{%- if server.config.engine == 'git' %}

home_assistant_config:
git.latest:
- name: {{ server.config.address }}
- target: /etc/home_assistant
- rev: {{ server.config.revision|default(server.config.branch) }}
{%- if grains.saltversion >= "2015.8.0" %}
- branch: {{ server.config.branch|default(server.config.revision) }}
{%- endif %}
- force_reset: {{ server.config.force_reset|default(False) }}

{%- else %}

home_assistant_config_dir:
file.directory:
- name: /etc/home_assistant
- mode: 700
- makedirs: true
- user: home_assistant
- require:
- virtualenv: {{ server.dir.base }}

home_assistant_config:
file.managed:
- name: /etc/home_assistant/configuration.yaml
@@ -40,7 +63,7 @@ home_assistant_config:
- user: home_assistant
- mode: 600
- require:
- file: home_assistant_dir
- file: home_assistant_config_dir

{%- if server.known_device is defined %}

@@ -56,4 +79,6 @@ home_assistant_know_devices:

{%- endif %}

{%- endif %}

{%- endif %}

+ 26
- 0
metadata/service/server/config/base.yml Bestand weergeven

@@ -0,0 +1,26 @@
parameters:
home_assistant:
server:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: 50.0
longitude: 14.4
# C for Celcius, F for Fahrenheit
temperature_unit: C
time_zone: Europe/Prague
plugin:
# View all events in a logbook
logbook:
# Discover some devices automatically
discovery:
# Enables support for tracking state changes over time.
history:
# Checks for available updates
updater:
# Enables the frontend
frontend:
# Allows you to issue voice commands from the frontend
conversation:
# Track the sun
sun:

+ 0
- 23
metadata/service/server/single.yml Bestand weergeven

@@ -9,26 +9,3 @@ parameters:
bind:
address: 0.0.0.0
port: 8123
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: 50.0
longitude: 14.4
# C for Celcius, F for Fahrenheit
temperature_unit: C
time_zone: Europe/Prague
plugin:
# View all events in a logbook
logbook:
# Discover some devices automatically
discovery:
# Enables support for tracking state changes over time.
history:
# Checks for available updates
updater:
# Enables the frontend
frontend:
# Allows you to issue voice commands from the frontend
conversation:
# Track the sun
sun:

Laden…
Annuleren
Opslaan