Skip to content

Commit

Permalink
🤖 22-12-24 | ♻️ Updated 7 files ✨ Added 2 files
Browse files Browse the repository at this point in the history
--------
- update: main-grid/grid_media.yaml
- update: docs/README.md
- update: config/configuration.yaml
- update: dashboard-resources/ytube-playlist-card.js
- update: dashboard-resources/template-editor-change.js
- update: config/README.md
- update: popup/popup_weather.yaml
- add: dashboard-resources/sidebar-divider-copy.js
- add: dashboard-resources/sidebar-divider.js

--------
Automated commit via script
  • Loading branch information
ngocjohn committed Dec 22, 2024
1 parent a6169b6 commit bb8b449
Show file tree
Hide file tree
Showing 9 changed files with 571 additions and 138 deletions.
10 changes: 2 additions & 8 deletions config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Hey there! Welcome to my little corner of the tech world! 👨‍💻

This is where I store all the cool configurations for my Home Assistant system. Well, it's a mix of awesome codes and setups I discovered from the Home Assistant community. Seriously, those folks are wizards! 🧙‍♂️ As a bit of an internet newbie turned tech enthusiast, I stumbled upon the magic of IT, and this repository is my way of sharing the joy and knowledge I've gained along the way. Dive in, explore, and let the tech magic begin! ✨

I frequently refresh my configuration files. My current Home Assistant version is <b>2024.12.4</b>. If you find something you like, don't forget to give my repository a ⭐️!
I frequently refresh my configuration files. My current Home Assistant version is <b>2024.12.5</b>. If you find something you like, don't forget to give my repository a ⭐️!

<video width="100%" controls loop muted>
<source src="https://github-production-user-asset-6210df.s3.amazonaws.com/96962827/297112091-acc1a4db-b92e-4ab1-ac9d-df067d4ba4d1.mp4" type="video/mp4">
Expand All @@ -37,7 +37,7 @@ https://github.com/ngocjohn/hass-config/assets/96962827/acc1a4db-b92e-4ab1-ac9d-
</thead>
<tbody>
<tr>
<td>36,198 </td>
<td>36,280 </td>
<td>34</td>
<td>178</td>
<td>63</td>
Expand Down Expand Up @@ -102,10 +102,8 @@ https://github.com/ngocjohn/hass-config/assets/96962827/acc1a4db-b92e-4ab1-ac9d-
- [Node Red Companion](https://github.com/zachowj/hass-node-red)
- [Nuki Lock](https://github.com/kvj/hass_nuki_ng)
- [Portainer](https://github.com/tomaae/homeassistant-portainer)
- [Remote Home Assistant](https://github.com/custom-components/remote_homeassistant)
- [Simpleicons](https://github.com/vigonotion/hass-simpleicons)
- [Spook 👻 Your Homie](https://github.com/frenck/spook)
- [Spotcast](https://github.com/fondberg/spotcast)
- [Spotifyplus](https://github.com/thlucas1/homeassistantcomponent_spotifyplus)
- [Webrtc Camera](https://github.com/AlexxIT/WebRTC)
- [Xiaomi Cloud Map Extractor](https://github.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor)
Expand Down Expand Up @@ -143,11 +141,9 @@ https://github.com/ngocjohn/hass-config/assets/96962827/acc1a4db-b92e-4ab1-ac9d-
- [Mini Media Player](https://github.com/kalkih/mini-media-player)
- [Multiple Entity Row](https://github.com/benct/lovelace-multiple-entity-row)
- [Mushroom](https://github.com/piitaya/lovelace-mushroom)
- [Paper Buttons Row](https://github.com/jcwillox/lovelace-paper-buttons-row)
- [Polr Ytube Media Card](https://github.com/pathofleastresistor/polr-ytube-media-card)
- [Purifier Card](https://github.com/denysdovhan/purifier-card)
- [Restriction Card](https://github.com/iantrich/restriction-card)
- [Roku Card](https://github.com/iantrich/roku-card)
- [Rpi Monitor Card](https://github.com/ironsheep/lovelace-rpi-monitor-card)
- [Simple Thermostat](https://github.com/nervetattoo/simple-thermostat)
- [Slider Button Card](https://github.com/custom-cards/slider-button-card)
Expand All @@ -160,10 +156,8 @@ https://github.com/ngocjohn/hass-config/assets/96962827/acc1a4db-b92e-4ab1-ac9d-
- [Timer Bar Card](https://github.com/rianadon/timer-bar-card)
- [Tv Remote Card (With Touchpad And Haptic Feedback)](https://github.com/usernein/tv-card)
- [Upcoming Media Card](https://github.com/xZetsubou/upcoming-media-card)
- [Uptime Card](https://github.com/dylandoamaral/uptime-card)
- [Vehicle Info Card](https://github.com/ngocjohn/vehicle-info-card)
- [Vehicle Status Card](https://github.com/ngocjohn/vehicle-status-card)
- [Vertical Stack In Card](https://github.com/ofekashery/vertical-stack-in-card)
- [Weather Card](https://github.com/bramkragten/weather-card)
- [Weather Chart Card](https://github.com/mlamberts78/weather-chart-card)
- [Weather Radar Card](https://github.com/Makin-Things/weather-radar-card)
Expand Down
4 changes: 3 additions & 1 deletion config/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ homeassistant:
media: /media
# FRONT - END
frontend:
extra_module_url:
- /local/dashboard-resources/sidebar-divider.js
- /local/dashboard-resources/template-editor-change.js
themes: !include_dir_merge_named themes

# HTTP
Expand All @@ -31,4 +34,3 @@ stt:
# INCLUDES
automation ui: !include automations.yaml
script: !include scripts.yaml

136 changes: 106 additions & 30 deletions config/dashboards/shared/popup/popup_weather.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,39 +55,115 @@ browser_mod:
marker_latitude: 50.075763
marker_longitude: 14.42036
zoom_level: 5
square_map: true
square_map: false
show_recenter: true
show_playback: false
- type: entities
title: Sunrise & Sunset
title: Lunar Phase
card_mod:
class: header
style: |
ha-card {
border: none !important;
}
entities:
# - type: custom:horizon-card
# moon: true
# refresh_period: 60
# fields:
# sunrise: true
# sunset: true
# dawn: true
# noon: true
# dusk: true
# azimuth: false
# elevation: false
# moonrise: true
# moonset: true
# moon_phase: true
# southern_flip: false
# moon_phase_rotation: -10
# language: en
# time_format: 24
# latitude: 50.55
# longitude: 14.25
# elevation: 300
# time_zone: Europe/Prague
# debug_level: 0
- type: custom:sun-card
- type: custom:lunar-phase-card
card_mod:
style:
.: |
ha-card {
background-color: transparent !important;
}
lunar-base-data $: |
.swiper-container {
backdrop-filter: none !important;
}
entity: ''
12hr_format: false
calendar_modal: false
compact_view: false
default_card: base
hide_buttons: false
mile_unit: false
moon_position: left
number_decimals: 2
selected_language: en
show_background: false
southern_hemisphere: false
use_custom: false
use_default: true
use_entity: false
graph_config:
graph_type: default
y_ticks: false
x_ticks: true
show_time: true
show_current: true
show_highest: true
y_ticks_position: left
y_ticks_step_size: 30
time_step_size: 30
show_legend: true
legend_position: top
legend_align: center
font_customize:
header_font_size: x-large
header_font_style: capitalize
header_font_color: ''
label_font_size: auto
label_font_style: none
label_font_color: ''
hide_label: false
hide_header: true
latitude: 50.060362328075634
longitude: 14.399342536926271
location:
city: Capital City of Prague
country: Czechia
custom_background: >-
https://cdn.jsdelivr.net/gh/ngocjohn/[email protected]/background/moon_bg_1.png
footer:
type: custom:lunar-phase-card
entity: ''
12hr_format: false
calendar_modal: false
compact_view: true
default_card: horizon
hide_buttons: true
mile_unit: false
moon_position: left
number_decimals: 2
selected_language: en
show_background: false
southern_hemisphere: false
use_custom: false
use_default: true
use_entity: false
graph_config:
graph_type: dynamic
y_ticks: false
x_ticks: true
show_time: true
show_current: true
show_highest: true
y_ticks_position: left
y_ticks_step_size: 30
time_step_size: 30
show_legend: true
legend_position: top
legend_align: center
font_customize:
header_font_size: x-large
header_font_style: capitalize
header_font_color: ''
label_font_size: auto
label_font_style: none
label_font_color: ''
hide_label: false
hide_header: true
latitude: 50.060362328075634
longitude: 14.399342536926271
location:
city: Capital City of Prague
country: Czechia
card_mod:
style: |
ha-card {
background-color: transparent !important;
}
7 changes: 5 additions & 2 deletions config/dashboards/views/main-grid/grid_media.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@
extra: sensor.ytube_music_player_extra
layout:
type: grid
max_columns: 3
max_rows: 3
max_grid_columns: 3
max_grid_rows: 3
max_list_items: 6
show_header: false
show_footer: false
default_page:
type: library_playlists

Expand Down
61 changes: 61 additions & 0 deletions config/www/dashboard-resources/sidebar-divider-copy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
console.info('Sidebar divider loaded');

function getSideBar() {
let root = document.querySelector('home-assistant');
root = root && root.shadowRoot;
root = root && root.querySelector('home-assistant-main');
root = root && root.shadowRoot;
root = root && root.querySelector('ha-drawer > ha-sidebar');
return root;
}

function addDivider() {
const hasidebar = getSideBar();
const sidebar = hasidebar.shadowRoot.querySelector('paper-listbox.ha-scrollbar');
const spacer = sidebar.querySelector('.spacer');
const logs = sidebar.querySelector('a[data-panel="config/logs"]');
const supervisor = sidebar.querySelector('a[data-panel="hassio/system/info"]');

if (spacer && logs && supervisor) {
// Insert logs after spacer
if (spacer.nextSibling) {
sidebar.insertBefore(logs, spacer.nextSibling);
} else {
sidebar.appendChild(logs); // If no nextSibling, append it to the end
}

// Insert supervisor after logs
if (logs.nextSibling) {
sidebar.insertBefore(supervisor, logs.nextSibling);
} else {
sidebar.appendChild(supervisor); // If no nextSibling, append it to the end
}
}
const divider = hasidebar.shadowRoot.querySelector('div.divider');
const media = sidebar.querySelector('a[data-panel="media-browser"]');
const addons = sidebar.querySelector('a[data-panel="hassio/dashboard"]');
if (divider && media && addons) {
const style = document.createElement('style');
style.textContent = `
div.divider::before {
background-color: rgba(138, 140, 153, 0.2);
}
`;
let dividerCopy = divider.cloneNode(true);
dividerCopy.appendChild(style);
sidebar.insertBefore(dividerCopy.cloneNode(true), addons);
sidebar.insertBefore(dividerCopy.cloneNode(true), media);
}
console.info('Sidebar divider added');
}

// Observe changes in the DOM to wait for the sidebar
const observer = new MutationObserver(() => {
if (getSideBar()) {
observer.disconnect(); // Stop observing once sidebar is found
addDivider();
}
});

// Start observing for changes
observer.observe(document.body, { childList: true, subtree: true });
51 changes: 51 additions & 0 deletions config/www/dashboard-resources/sidebar-divider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
customElements.whenDefined('ha-sidebar').then(() => {
const Sidebar = customElements.get('ha-sidebar');

// Extend the `firstUpdated` method
const originalFirstUpdated = Sidebar.prototype.firstUpdated;
Sidebar.prototype.firstUpdated = function () {
// Call the original `firstUpdated` if it exists
if (originalFirstUpdated) {
originalFirstUpdated.call(this);
}

const sidebar = this.shadowRoot.querySelector('paper-listbox.ha-scrollbar');
const spacer = sidebar.querySelector('.spacer');
const logs = sidebar.querySelector('a[data-panel="config/logs"]');
const supervisor = sidebar.querySelector('a[data-panel="hassio/system/info"]');

if (spacer && logs && supervisor) {
// Insert logs after spacer
if (spacer.nextSibling) {
sidebar.insertBefore(logs, spacer.nextSibling);
} else {
sidebar.appendChild(logs); // If no nextSibling, append it to the end
}

// Insert supervisor after logs
if (logs.nextSibling) {
sidebar.insertBefore(supervisor, logs.nextSibling);
} else {
sidebar.appendChild(supervisor); // If no nextSibling, append it to the end
}
}

const divider = this.shadowRoot.querySelector('div.divider');
const media = sidebar.querySelector('a[data-panel="media-browser"]');
const addons = sidebar.querySelector('a[data-panel="hassio/dashboard"]');
if (divider && media && addons) {
const style = document.createElement('style');
style.textContent = `
div.divider::before {
background-color: rgba(138, 140, 153, 0.2);
}
`;
let dividerCopy = divider.cloneNode(true);
dividerCopy.appendChild(style);
sidebar.insertBefore(dividerCopy.cloneNode(true), addons);
sidebar.insertBefore(dividerCopy.cloneNode(true), media);
}

console.info('Sidebar divider added successfully');
};
});
Loading

0 comments on commit bb8b449

Please sign in to comment.