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
# In Home Assistant UI, navigate to dev-info page and click on "Try out the new Lovelace UI" (HASS 0.72+) | |
# Reference the file in your configuration file | |
frontend: | |
extra_html_url: | |
- /local/wired-cards.html | |
# Example entities used in sample ui-lovelacy.yaml below | |
input_boolean: | |
switch_ac_kitchen: |
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
views: | |
- name: Example | |
cards: | |
- type: 'custom:my-element' | |
entity_id: input_boolean.switch_ac_kitchen |
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
"""Basis for a BLE discovery component. | |
To add to Home Assistant, copy this file to | |
<config>/custom_components/ble_discovery.py | |
Add to your configuration.yaml: | |
``` | |
ble_discovery: |
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 is the Ikea Tradfri code from @ggravlingen extracted into a lib. | |
https://github.com/ggravlingen/home-assistant/blob/master/custom_components/light/ikeatradfri.py | |
Depends on modified coap-client with dtls support. Build instructions here: | |
https://community.home-assistant.io/t/ikea-tradfri-gateway-zigbee-very-basic-working-implementation/14788/19?u=balloob | |
Run with python3 -i pytradfri.py IP KEY | |
Will give you an interactive Python shell: |
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
'use strict'; | |
Object.defineProperty(exports, '__esModule', { value: true }); | |
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | |
var React = require('react'); | |
var React__default = _interopDefault(React); | |
var PropTypes = _interopDefault(require('prop-types')); | |
var classNames = _interopDefault(require('classnames')); |
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
Param( | |
[Parameter(Mandatory=$True)] | |
[string]$FilePath | |
) | |
$Files = Get-ChildItem "$FilePath\*.docx" | |
$Word = New-Object -ComObject Word.Application | |
Foreach ($File in $Files) { |
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
class AsyncFileHandler(): | |
def __init__(self, loop, handler): | |
"""Initialize async logging file handle.""" | |
self.handler = handler | |
self.loop = loop | |
self._queue = asyncio.Queue(loop=loop) | |
self._thread = threading.Thread(target=self._process) | |
def start_thread(self): | |
"""Start thread for processing.""" |
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
""" | |
Support for MQTT lights. | |
For more details about this platform, please refer to the documentation at | |
https://home-assistant.io/components/light.mqtt/ | |
""" | |
import logging | |
from functools import partial | |
import homeassistant.components.mqtt as mqtt |
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
""" | |
Component to track where spectacles are being sold. | |
To install: | |
- Install Home Assistant (duh): https://home-assistant.io | |
- Add this file as <config dir>/custom_components/sensor/spectacles.py | |
- Add to configuration.yaml: | |
sensor: | |
platform: spectacles |
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
from multiprocessing.dummy import Pool | |
import sys | |
import time | |
from homeassistant import remote | |
# Docs: remote.API(host, [password], [port], [use_ssl]) | |
api = remote.API('127.0.0.1') | |
start_time = time.time() |