-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🤖 22-12-24 | ♻️ Updated 7 files ✨ Added 2 files
-------- - 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
Showing
9 changed files
with
571 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}; | ||
}); |
Oops, something went wrong.