Skip to content

Instantly share code, notes, and snippets.

View pelrun's full-sized avatar

James Churchill pelrun

  • Melbourne, Australia
View GitHub Profile
@pelrun
pelrun / set_state.py
Last active January 30, 2024 08:24
Home Assistant script to set an entity's state, used with the IKEA Tradfri remote control.
if 'entity_id' not in data:
logger.warning("===== entity_id is required if you want to set something.")
else:
data = data.copy()
inputEntity = data.pop('entity_id')
inputStateObject = hass.states.get(inputEntity)
if inputStateObject:
inputState = inputStateObject.state
inputAttributesObject = inputStateObject.attributes.copy()
else:
#!/bin/bash
echo "JeVois easy install 1.0 for Ubuntu 16.10 -- Welcome."
####################################################################################################
read -p "Install Ubuntu packages needed by JeVois [Y/n]? "
if [ "X$REPLY" != "Xn" ]; then
sudo apt-get update
packages=(
import numpy as np
import cv2
import urllib
import ssl
import time
maxWidth = 320
maxHeight = 240
maxClean = 71000.0
minClean = maxClean/2