Skip to content

Instantly share code, notes, and snippets.

@boralyl
boralyl / __init__.py
Created Mar 26, 2020
Home Assistant LG Washer/Dryer Custom Component
View __init__.py
"""
Support for LG Smartthinq device.
This is made for korean only.
If you want to apply other county devices, you should change the code little bit.
"""
import logging
import wideq
import voluptuous as vol
View app.py
from datetime import datetime, timedelta
import json
import time
import ephem
from flask import Flask
import requests
from werkzeug.contrib.fixers import ProxyFix
from constants import MAIN_LIGHTS_GROUP_ID
View utils.py
from functools import partial
import json
import multiprocessing
import requests
from constants import (ALL_LIGHTS_GROUP_ID, GROUP_STATE_URL, LIGHT_IDS,
LIGHT_URL, LIGHT_STATE_URL)
View observations.py
# 1) 2 blank spaces between a function definition and end. i.e.
import foo
def diinosaur():
pass
def something_else():
pass
@boralyl
boralyl / fabex.py
Created Jan 19, 2012
Fabfile Example
View fabex.py
from __future__ import with_statement
from fabric.api import *
env.roledefs = {
'production': ['user@domain.com'],
'localhost': ['user@localhost'],
}
REMOTE_APP_DIR = "/path/to/remote/app"