Skip to content

Instantly share code, notes, and snippets.

@and7ey
and7ey / oico.py
Last active May 18, 2024 08:38
Home Assistant pyscript to get data from OICO / Etalok UK
"""
service: pyscript.oico_get_counters
data:
address_id: 310379
counters:
- counter_id: 123456 # электроэнергия
mqtt_topic1: 'oico/energy-meter/t1'
mqtt_topic2: 'oico/energy-meter/t2'
mqtt_topic3: 'oico/energy-meter/t3'
- counter_id: 7890123 # отопление
@and7ey
and7ey / keenetic.py
Created May 18, 2024 08:35
Home assistant pyscript for Keenetic
"""
The script allows to modify internet availability schedule for particular device connected to Keenetic router.
Script to be used with Pyscript HACS custom integration (https://github.com/custom-components/pyscript).
The following configuration is required (at configuration.yaml):
pyscript:
allow_all_imports: true
apps:
keenetic:
@and7ey
and7ey / Pocketmine.sublime-build
Created May 16, 2024 19:00
Sublime Build to upload Pocketmine plugins and start the server
// http://www.sublimetext.com/docs/3/build_systems.html
{
"keyfiles": ["plugin.yml"],
"quiet": true,
// "syntax": "Packages/ShellScript/Bash.sublime-syntax",
"variants":
[
{
"name": "Pack & upload plugin",
"shell_cmd": "/Users/andrey/Documents/Dev/Other/MinecraftPMMP/packPlugin.command $folder"
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
name: YC Log
file_extensions: [log]
scope: source.example-c
contexts:
main:
# Request identifiers
- match: '\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} (START|END|REPORT) RequestID: .*'
// https://developers.home-assistant.io/docs/api/rest
// http://www.sublimetext.com/docs/3/build_systems.html
{
"keyfiles": ["manifest.json"],
"quiet": true,
"syntax": "Packages/ShellScript/Bash.sublime-syntax",
"variants":
[
{
"name": "Restart Server",
@and7ey
and7ey / Home Assistant.sublime-build
Created May 16, 2024 14:11
Sublime Build system to test Home Assistant plugins / integrations
// https://developers.home-assistant.io/docs/api/rest
// http://www.sublimetext.com/docs/3/build_systems.html
{
"keyfiles": ["manifest.json"],
"quiet": true,
"syntax": "Packages/ShellScript/Bash.sublime-syntax",
"variants":
[
{
"name": "Restart Server",
@and7ey
and7ey / GoogleAppEngineDevServerLog.sublime-syntax
Created May 16, 2024 14:09
Google App Engine Server Log Syntax Highlighting
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
name: GAE Dev Server Log
file_extensions: [log]
scope: source.example-c
contexts:
main:
# Strings begin and end with quotes, and use backslashes as an escape
# character
// http://www.sublimetext.com/docs/3/build_systems.html
// https://cloud.google.com/sdk/gcloud/reference/app
{
//"file_patterns": ["*.py", "*.yaml"],
"keyfiles": ["app.yaml"],
"quiet": true,
"variants":
[
{
"name": "Run local server",
@and7ey
and7ey / configuration.yaml
Last active March 24, 2024 18:20
Home Assistant - FireLamp_JeeUI 2.7.0 (Gyverlamp)
mqtt:
# https://www.home-assistant.io/integrations/light.mqtt/
light:
- name: "firelamp"
unique_id: "firelamp_1234567890"
state_topic: "firelamp/embui/pub/on"
command_topic: "firelamp/embui/set/on"
payload_on: "1"
payload_off: "0"
brightness_command_topic: "firelamp/embui/set/g_bright"
@and7ey
and7ey / kinopoisk_sync.py
Created March 17, 2024 16:43
Скрипт на python для синхронизации списка Буду смотреть Кинопоиска между аккаунтами и добавления торрентов на TorrServer
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions
import time
import os
import json
import sys
import requests