From 33786c14c0a6434dfad1155ac528b47ab09d7a53 Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Thu, 3 Nov 2022 10:02:37 +0200 Subject: [PATCH] Add homeassistant docker for development --- devtools/homeassistant/configuration.yaml | 27 ++++++++ devtools/homeassistant/ui-lovelace.yaml | 83 +++++++++++++++++++++++ package.json | 3 +- 3 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 devtools/homeassistant/configuration.yaml create mode 100644 devtools/homeassistant/ui-lovelace.yaml diff --git a/devtools/homeassistant/configuration.yaml b/devtools/homeassistant/configuration.yaml new file mode 100644 index 0000000..2f615a0 --- /dev/null +++ b/devtools/homeassistant/configuration.yaml @@ -0,0 +1,27 @@ +# Configure a default setup of Home Assistant (frontend, api, etc) +default_config: + +homeassistant: + packages: !include_dir_named packages/ + +logger: + default: info + logs: + hacs: debug + +lovelace: + mode: yaml + resources: + - type: module + url: /hacsfiles/button-card/button-card.js + - type: module + url: /hacsfiles/lovelace-state-switch/state-switch.js + - type: module + url: http://localhost:5000/time-picker-card.js + dashboards: + lovelace-home: + mode: yaml + title: Home + icon: mdi:home + show_in_sidebar: true + filename: ui-lovelace.yaml diff --git a/devtools/homeassistant/ui-lovelace.yaml b/devtools/homeassistant/ui-lovelace.yaml new file mode 100644 index 0000000..fafd963 --- /dev/null +++ b/devtools/homeassistant/ui-lovelace.yaml @@ -0,0 +1,83 @@ +title: Home +views: + - title: Grid + path: grid + cards: + - type: grid + cards: + - type: button + icon: mdi:reload + name: Theme + tap_action: + action: call-service + service: frontend.reload_themes + - type: custom:time-picker-card + entity: input_datetime.test_date_time + link_values: true + hour_mode: 12 + hour_step: 2 + minute_step: 3 + layout: + hour_mode: single + name: inside + hide: + name: false + - type: entities + entities: + - input_datetime.test_date_time + - input_datetime.test_date_time + - input_datetime.test_date_time + - input_datetime.test_date_time + - input_datetime.test_date_time + - input_datetime.test_date_time + + + - title: dev + path: dev + cards: + - type: vertical-stack + cards: + - type: markdown + content: "# 🕰 Time Picker Card dev" + - type: entities + entities: + - input_datetime.test_date_time + - type: horizontal-stack + cards: + - type: custom:time-picker-card + entity: input_datetime.test_date_time + name: Alarm time + hour_mode: 24 + hour_step: 2 + - type: custom:time-picker-card + entity: input_datetime.test_date_time + hour_mode: 12 + layout: + hour_mode: single + hide: + name: true + + - type: custom:time-picker-card + entity: input_datetime.test_date_time + - type: custom:time-picker-card + entity: input_datetime.test_date_time + hide: + seconds: false + + - type: horizontal-stack + cards: + - type: custom:time-picker-card + entity: input_datetime.test_date_time + hour_mode: 12 + hide: + name: true + - type: custom:time-picker-card + entity: input_datetime.test_date_time + link_values: true + hour_mode: 12 + hour_step: 2 + minute_step: 3 + layout: + hour_mode: single + hide: + name: false diff --git a/package.json b/package.json index 994a662..c6578f3 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "test": "./node_modules/karma/bin/karma start ./test/karma.conf.js", "release-patch": "npm version patch && git push origin master --tags", "release-minor": "npm version minor && git push origin master --tags", - "release-major": "npm version major && git push origin master --tags" + "release-major": "npm version major && git push origin master --tags", + "start:ha": "docker run --rm -p8124:8123 -v $(pwd)/devtools/homeassistant:/config homeassistant/home-assistant:latest", }, "dependencies": { "custom-card-helpers": "^1.6.6",