Skip to content

Instantly share code, notes, and snippets.

View CoMPaTech's full-sized avatar
😎
Coding along

Tom CoMPaTech

😎
Coding along
  • CoMPa Technology
  • The Netherlands
  • 07:14 (UTC -12:00)
View GitHub Profile
@CoMPaTech
CoMPaTech / patch.py
Created July 18, 2020 19:49
not working testing
diff --git a/tests/components/plugwise/test_config_flow.py b/tests/components/plugwise/test_config_flow.py
index feb695aae8..22a6fc6079 100644
--- a/tests/components/plugwise/test_config_flow.py
+++ b/tests/components/plugwise/test_config_flow.py
@@ -2,10 +2,19 @@
from Plugwise_Smile.Smile import Smile
import pytest
-from homeassistant import config_entries, setup
-from homeassistant.components.plugwise.const import DOMAIN
@CoMPaTech
CoMPaTech / zero.py
Created June 17, 2020 17:47
zeroconf discovery
from zeroconf import ServiceBrowser, Zeroconf
class MyListener:
def remove_service(self, zeroconf, type, name):
print("Service %s removed\n" % (name,))
def add_service(self, zeroconf, type, name):
info = zeroconf.get_service_info(type, name)
@CoMPaTech
CoMPaTech / test_climate.py
Created May 30, 2020 09:25
HA testing for plugwise
"""Tests for the tado integration."""
from homeassistant.components.plugwise import DOMAIN
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry, load_fixture
from tests.test_util.aiohttp import AiohttpClientMocker
import pytest
@CoMPaTech
CoMPaTech / patch109
Created April 26, 2020 09:15
HA 109 for plugwise-beta
diff --git a/custom_components/plugwise-beta/climate.py b/custom_components/plugwise-beta/climate.py
index ae1a1cc..41a6e6b 100644
--- a/custom_components/plugwise-beta/climate.py
+++ b/custom_components/plugwise-beta/climate.py
@@ -3,7 +3,7 @@
import logging
from typing import Dict
-from homeassistant.components.climate import ClimateDevice
+from homeassistant.components.climate import ClimateEntity
@CoMPaTech
CoMPaTech / control.sh
Created April 9, 2020 14:04
rfxcom control
#!/bin/sh
rfxcmd="/root/rfx-program/rfxcmd/rfxcmd.py"
#serial=`find /dev/serial/by-id -type l`
serial="/dev/ttyUSB0"
# Beamer (Kingpin)
#09130011E1428041000
# xxxx - 1040 timing/pulse in hex
# xx - Command (24/stop 22/up 28/down)
@CoMPaTech
CoMPaTech / thermo_finding.py
Last active March 31, 2020 19:39
thermo finding
# used match_locations to determin type of location (i.e. must be thermostat)
# then ran along finding master/slaves
# in general ... this should be ran after 'connect'
# so match_locations finds the 'thermostat' locations
# this finds masters and slaves
# and returns something into self._slaves
# self._slaves is a list (or set([])) of things that are slave
<?xml version="1.0" encoding="UTF-8"?>
<domain_objects>
<module id='2174b15978334867a3d634a16d14ada8'>
<vendor_name>Plugwise</vendor_name>
<vendor_model>ThermoTouch</vendor_model>
<hardware_version>6539-1301-5002</hardware_version>
<firmware_version>2018-02-08T11:15:53+01:00</firmware_version>
<upgrade/>
<created_date>2019-04-23T20:32:36.476+02:00</created_date>
<?xml version="1.0" encoding="UTF-8"?>
<domain_objects>
<module id='2174b15978334867a3d634a16d14ada8'>
<vendor_name>Plugwise</vendor_name>
<vendor_model>ThermoTouch</vendor_model>
<hardware_version>6539-1301-5002</hardware_version>
<firmware_version>2018-02-08T11:15:53+01:00</firmware_version>
<upgrade/>
<created_date>2019-04-23T20:32:36.476+02:00</created_date>
<modified_date>2019-04-23T21:51:27.014+02:00</modified_date>
@CoMPaTech
CoMPaTech / Charging2.json
Created April 14, 2019 08:33
teslascraper charging dashboard
{
"__inputs": [
{
"name": "DS_TESLASCRAPER",
"label": "TeslaScraper",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
"pluginName": "InfluxDB"
},
@CoMPaTech
CoMPaTech / grafana_projected-max-range_panel.json
Created April 3, 2019 08:57
Additional panel for battery health (lephisto/tesla-apiscraper) : Note the ###FIXTHIS### entries
{
"aliasColors": {
"Ideal range vs Battery level": "#e24d42",
"charge_state.mean_mean": "#e24d42"
},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "###FIXTHIS###",
"fill": 1,