From 0f7a8aa73bd7e08f3a457956a9e284e67dcf32e1 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 22 Jan 2020 21:05:26 +0100 Subject: [PATCH 1/6] Improve cache busting (#11846) --- plugins/cache_buster.rb | 10 ++++++++++ source/_includes/javascripts/scripts.html | 2 +- source/_includes/site/head.html | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 plugins/cache_buster.rb diff --git a/plugins/cache_buster.rb b/plugins/cache_buster.rb new file mode 100644 index 00000000000..895b39a2eeb --- /dev/null +++ b/plugins/cache_buster.rb @@ -0,0 +1,10 @@ +module Jekyll + module CacheBuster + require 'digest/md5' + def cache_buster(file_name) + [file_name, '?', Digest::MD5.hexdigest(File.read(File.join('./source', file_name)))].join + end + end +end + +Liquid::Template.register_filter(Jekyll::CacheBuster) diff --git a/source/_includes/javascripts/scripts.html b/source/_includes/javascripts/scripts.html index 4330401c789..79868bc88da 100644 --- a/source/_includes/javascripts/scripts.html +++ b/source/_includes/javascripts/scripts.html @@ -5,7 +5,7 @@ g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js s.parentNode.insertBefore(g,s)}(document,'script')); - + diff --git a/source/_includes/site/head.html b/source/_includes/site/head.html index 35b140ccf88..b965a92e387 100644 --- a/source/_includes/site/head.html +++ b/source/_includes/site/head.html @@ -28,8 +28,8 @@ - - + + From 8a11484abe7f90c98b6be862124c85bc00db751e Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 22 Jan 2020 21:05:37 +0100 Subject: [PATCH 2/6] Improve GitHub Actions PR workflow (#11845) --- .github/workflows/markdown.yml | 20 ----------- .github/workflows/test.yml | 62 ++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/markdown.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/markdown.yml b/.github/workflows/markdown.yml deleted file mode 100644 index 1f74dac813e..00000000000 --- a/.github/workflows/markdown.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Markdown - -on: [push, pull_request] - -jobs: - remark: - runs-on: ubuntu-latest - steps: - - name: Checking out files from GitHub - uses: actions/checkout@v1 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: Installing dependencies - run: npm install - env: - CI: true - - name: Running remark lint - run: npm run markdown:lint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000000..f924178e3a1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,62 @@ +name: home-assistant.io Test + +on: [push, pull_request] + +jobs: + markdown-lint: + name: Lint Markdown + runs-on: ubuntu-latest + steps: + - name: Check out files from GitHub + uses: actions/checkout@v2 + - name: Setting up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: Setup NPM cache + uses: actions/cache@v1 + with: + path: ~/.npm + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- + - name: Install dependencies + run: npm install + env: + CI: true + - name: Run remark lint + run: npm run markdown:lint + build: + name: Jekyll build + runs-on: ubuntu-latest + needs: [markdown-lint] + steps: + - name: Check out files from GitHub + uses: actions/checkout@v2 + - name: Setting up Ruby 2.6 + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6 + - name: Setup Ruby Gems cache + uses: actions/cache@v1 + with: + path: vendor/bundle + key: gems-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + gems- + - name: Installing dependencies + run: | + gem install bundler -v 2.0.1 + bundle config path vendor/bundle + bundle install --jobs 4 --retry 3 + - name: Setting up Jekyll cache + uses: actions/cache@v1 + with: + path: source/.jekyll-cache + key: jekyll-${{ hashFiles('**/Gemfile.lock') }}-${{ hashFiles('**/_config.yml') }} + restore-keys: | + jekyll-${{ hashFiles('**/Gemfile.lock') }}- + jekyll- + - name: Building site + run: | + bundle exec rake generate From 23cafa190888133f6a3be35655e04835c2cf9d8b Mon Sep 17 00:00:00 2001 From: Brandon Date: Wed, 22 Jan 2020 19:06:58 -0500 Subject: [PATCH 3/6] Spelling fix for duaration -> duration (#11847) typo fix. --- source/_integrations/simplisafe.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_integrations/simplisafe.markdown b/source/_integrations/simplisafe.markdown index fab3604c3e5..cda5d09fc88 100644 --- a/source/_integrations/simplisafe.markdown +++ b/source/_integrations/simplisafe.markdown @@ -67,7 +67,7 @@ Set the duration (in seconds) of an active alarm. | Service Data Attribute | Optional | Description | |---------------------------|----------|---------------------------------------------| | `system_id` | no | The ID of a SimpliSafe system | -| `duaration` | no | The number of seconds to sound the alarm | +| `duration` | no | The number of seconds to sound the alarm | ### `simplisafe.set_delay` From 6862d132449d4dfe6086f5abf0821db20d8ff713 Mon Sep 17 00:00:00 2001 From: eracknaphobia Date: Thu, 23 Jan 2020 03:46:19 -0500 Subject: [PATCH 4/6] Update glances.markdown (#11849) --- source/_integrations/glances.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_integrations/glances.markdown b/source/_integrations/glances.markdown index 3e8db64e1c5..362b6444430 100644 --- a/source/_integrations/glances.markdown +++ b/source/_integrations/glances.markdown @@ -112,4 +112,4 @@ Glances integration will add the following sensors: - docker_cpu_use: The total CPU usage in percent of Docker containers. - docker_memory_use: The total memory used by Docker containers. -Not all platforms are able to provide all metrics. For instance `cpu_temp` is requires installing and configuring `lmsensors` in Ubuntu, and may not be available at all in other platforms. +Not all platforms are able to provide all metrics. For instance `cpu_temp` requires installing and configuring `lmsensors` in Ubuntu, and may not be available at all in other platforms. From 83280ea57a5db1f0ff07ae8d2b71bc2225632ac8 Mon Sep 17 00:00:00 2001 From: Michael Lunzer Date: Thu, 23 Jan 2020 01:46:11 -0800 Subject: [PATCH 5/6] Added bonus template sensors to convert kilograms to pounds (#11779) * Added bonus template sensors to convert kilograms to pounds added bonus template sensors to convert kilograms to pounds. This will save users from having to re-invent the wheel on their own. * added {% raw %} tags * edited {% raw %} tags --- source/_integrations/withings.markdown | 53 ++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/source/_integrations/withings.markdown b/source/_integrations/withings.markdown index 290422352ee..8e0ce082614 100644 --- a/source/_integrations/withings.markdown +++ b/source/_integrations/withings.markdown @@ -84,3 +84,56 @@ profiles: required: true type: map {% endconfiguration %} + +## Bonus: Template Sensors to Convert Kilograms to Pounds + +In a text editor, replace ```USER_PROFILE_NAME``` in the template sensors below with your withings User Profile Name defined in the Withings integration configuration. + + +{% raw %} + +```yaml +# Example configuration.yaml entry +sensors: + - platform: template + sensors: + withings_weight_lbs_USER_PROFILE_NAME: + friendly_name: "withings weight_lbs_USER_PROFILE_NAME" + unit_of_measurement: 'lbs' + value_template: "{{ (states('sensor.withings_weight_kg_USER_PROFILE_NAME') | float * 2.20462262185) | round(2) }}" + icon_template: mdi:weight-pound + + - platform: template + sensors: + withings_bone_mass_lbs_USER_PROFILE_NAME: + friendly_name: "withings bone_mass_lbs_USER_PROFILE_NAME" + unit_of_measurement: 'lbs' + value_template: "{{ (states('sensor.withings_bone_mass_kg_USER_PROFILE_NAME') | float * 2.20462262185) | round(2) }}" + icon_template: mdi:weight-pound + + - platform: template + sensors: + withings_fat_free_mass_lbs_USER_PROFILE_NAME: + friendly_name: "withings fat_free_mass_lbs_USER_PROFILE_NAME" + unit_of_measurement: 'lbs' + value_template: "{{ (states('sensor.withings_fat_free_mass_kg_USER_PROFILE_NAME') | float * 2.20462262185) | round(2) }}" + icon_template: mdi:weight-pound + + - platform: template + sensors: + withings_fat_mass_lbs_USER_PROFILE_NAME: + friendly_name: "withings fat_mass_lbs_USER_PROFILE_NAME" + unit_of_measurement: 'lbs' + value_template: "{{ (states('sensor.withings_fat_mass_kg_USER_PROFILE_NAME') | float * 2.20462262185) | round(2) }}" + icon_template: mdi:weight-pound + + - platform: template + sensors: + withings_muscle_mass_lbs_USER_PROFILE_NAME: + friendly_name: "withings muscle_mass_lbs_USER_PROFILE_NAME" + unit_of_measurement: 'lbs' + value_template: "{{ (states('sensor.withings_muscle_mass_kg_USER_PROFILE_NAME') | float * 2.20462262185) | round(2) }}" + icon_template: mdi:weight-pound +``` + +{% endraw %} \ No newline at end of file From 627608ab2d2a06f8f370dddcbe85f78b8321c529 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 23 Jan 2020 11:22:31 +0100 Subject: [PATCH 6/6] Add deploys by netlify badges (#11850) --- README.md | 3 ++- source/_includes/site/footer.html | 7 +++++-- source/images/frontpage/netlify.svg | 22 ++++++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 source/images/frontpage/netlify.svg diff --git a/README.md b/README.md index 5fd4c6e2389..06146e2b09c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ [![Discord](https://img.shields.io/discord/330944238910963714.svg)](https://discord.gg/CxqDrfU) -[![Krihelimeter](https://img.shields.io/badge/Krihelimeter-unknown-brightgreen.svg)](http://www.krihelinator.xyz) [![License: CC BY-NC-SA 4.0](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/) +[![Deploys by netlify](https://www.netlify.com/img/global/badges/netlify-color-bg.svg)](https://www.netlify.com) + # Home Assistant website This is the source for the [Home-Assistant.io website](https://home-assistant.io). diff --git a/source/_includes/site/footer.html b/source/_includes/site/footer.html index 64f21919d5b..748f6b58340 100644 --- a/source/_includes/site/footer.html +++ b/source/_includes/site/footer.html @@ -27,8 +27,11 @@ diff --git a/source/images/frontpage/netlify.svg b/source/images/frontpage/netlify.svg new file mode 100644 index 00000000000..25a6c275d31 --- /dev/null +++ b/source/images/frontpage/netlify.svg @@ -0,0 +1,22 @@ + + + + netlify-callout-vertical-color-bg + Created with Sketch. + + + + + + + + + + + + + + + + + \ No newline at end of file