Skip to content

Instantly share code, notes, and snippets.

View ggravlingen's full-sized avatar

Patrik Lindgren ggravlingen

  • Stockholm, Sweden
View GitHub Profile
@ggravlingen
ggravlingen / cover.py
Created October 11, 2019 20:07
Test for tradfri
"""Support for IKEA Tradfri covers."""
import logging
from pytradfri.error import PytradfriError
from homeassistant.components.cover import (
CoverDevice,
ATTR_POSITION,
SUPPORT_OPEN,
SUPPORT_CLOSE,
#!/usr/bin/env python3
"""
This is an example of how the pytradfri-library can be used async.
To run the script, do the following:
$ pip3 install pytradfri
$ Download this file (example_async.py)
$ python3 example_async.py <IP>
Where <IP> is the address to your IKEA gateway. The first time
name: Patriks hem
views:
# The name of a view will be used as tab title.
# Might be used for other things in the future.
- name: Example
tab_icon: mdi:home-assistant
# Each view can have a different theme applied. Theme should be defined in the frontend.
# The cards to show on this view.
cards:
import asyncio
import logging
import sys
import argparse
import uuid
import time
from pytradfri import Gateway