Browse Source

Git config

pull/1/head
Ales Komarek 7 years ago
parent
commit
572f94b3ba
6 changed files with 85 additions and 31 deletions
  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 View File



==================================
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 Sample pillars
============== ==============
address: 0.0.0.0 address: 0.0.0.0
port: 8123 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/ * https://home-assistant.io/getting-started/



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



+ 3
- 1
home_assistant/files/supervisor.conf View File

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


[program:home_assistant_server] [program:home_assistant_server]
command=/srv/home_assistant/bin/hass --config /etc/home_assistant/ command=/srv/home_assistant/bin/hass --config /etc/home_assistant/
stdout_logfile=/var/log/home_assistant/home_assistant.log stdout_logfile=/var/log/home_assistant/home_assistant.log
stdout_logfile_maxbytes=1MB stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10 stdout_logfile_backups=10
user=home_assistant
user={{ server.user }}

+ 6
- 0
home_assistant/map.jinja View File

pkgs: pkgs:
- python3-dev - python3-dev
- python3-pip - python3-pip
bind:
address: 0.0.0.0
port: 8123
dir: dir:
base: /srv/home_assistant base: /srv/home_assistant
config:
engine: local
user: home_assistant
{%- endload %} {%- endload %}


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

+ 26
- 1
home_assistant/server.sls View File

- require: - require:
- virtualenv: {{ server.dir.base }} - 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: home_assistant_config:
file.managed: file.managed:
- name: /etc/home_assistant/configuration.yaml - name: /etc/home_assistant/configuration.yaml
- user: home_assistant - user: home_assistant
- mode: 600 - mode: 600
- require: - require:
- file: home_assistant_dir
- file: home_assistant_config_dir


{%- if server.known_device is defined %} {%- if server.known_device is defined %}




{%- endif %} {%- endif %}


{%- endif %}

{%- endif %} {%- endif %}

+ 26
- 0
metadata/service/server/config/base.yml View File

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 View File

bind: bind:
address: 0.0.0.0 address: 0.0.0.0
port: 8123 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:

Loading…
Cancel
Save