Skip to content

Instantly share code, notes, and snippets.

View isabellaalstrom's full-sized avatar

Isabella Gross Alström isabellaalstrom

View GitHub Profile
@rille111
rille111 / wakeupapp-homeassistant.cs
Last active February 25, 2019 11:33
Example for a C# .NET Home-Assistant consuming app
using System.Threading.Tasks;
using NLog;
using Rille.Hass.ApiProxy;
using Rille.Hass.AppStarter;
using Rille.Hass.Models.StateChangeEventGraph;
namespace HassLab.Console.HassApps
{
public class WakeUpApp : IHassApp
{
@ciotlosm
ciotlosm / Readme.md
Last active February 5, 2024 15:04
Kiosk mode for lovelace

Kiosk mode

Installation

Add kiosk.js file with the content below to your www folder in config.

Like any other custom script, use ui-lovelace.yaml resources section to reference the kiosk.js file.

Make sure you add kiosk somewhere in your URL. You can use it in the id of your view or in the query string.

class LightSlider extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
this._state = {};
}
set hass(hass) {
this._hass = hass;
const entity = hass.states[this._config.entity];
if (entity && entity.state != this._state.state || entity.attributes.brightness != this._state.brightness) {
@darox
darox / gist:1efb30a59cbebab3bdb06c8b56899baf
Created March 27, 2023 18:08
single-value-home-assistant
let widget = await createWidget();
if (!config.runsInWidget) {
await widget.presentSmall();
}
Script.setWidget(widget);
Script.complete();