Skip to content

Instantly share code, notes, and snippets.

View andrey-yantsen's full-sized avatar

Andrew Y. andrey-yantsen

View GitHub Profile
@andrey-yantsen
andrey-yantsen / Plugin logic.js
Last active January 22, 2023 13:55
Roborock S7 status debug
if (this.state == RobotState.CHARGING && !this.isCleanMopMoppingMode() && this.cleanResumeFlag != CleanResumeFlag.None && !this.hasShownChargingResumeCleanReminder) {
if (this.notDisturbEnabled) {
reminders = reminders.concat('chargingResumeNoDisturbClean');
} else {
reminders = reminders.concat('chargingResumeClean');
}
this.hasShownChargingResumeCleanReminder = true;
}
{
"home_assistant": {
"installation_type": "Home Assistant Container",
"version": "2022.2.0b0",
"dev": false,
"hassio": false,
"virtualenv": false,
"python_version": "3.9.7",
"docker": true,
"arch": "x86_64",
@andrey-yantsen
andrey-yantsen / README.md
Last active July 27, 2024 08:30
Binge-watching scripts for sonarr+plex

Summary

Normally, when you're watching a TV-Show — you don't need all its episodes right away; you just need a few for the next hour or so. The following scripts help you with exactly this! plex-autotag.py marks the new shows you add with tag keep1; plex-autodelete.py removes watched episodes from your drive; sonarr-refresher.py triggers sonarr to download few new episodes, to keep you always having your next fix. All in all — sonarr will download you a new episode after you've watched one.

All this magic works only for "main" user.

The autodelete script was originally taken from plex-api and then it was modified to remove only watched episodes, plus I've added a couple of tags.

It would've been better to make the sonarr script to work directly with Plex API instead of relying on the deleted files, but I'm not there yet.

Keybase proof

I hereby claim:

  • I am andrey-yantsen on github.
  • I am virus (https://keybase.io/virus) on keybase.
  • I have a public key whose fingerprint is 25AA D6CF FACF 348E A28D 288B 2571 2C9E 747F AE22

To claim this, I am signing this object:

@andrey-yantsen
andrey-yantsen / README.md
Last active April 1, 2020 19:54
Workaround for openhab/openhab2-addons#3522

This script monitors openhab log for messages like Terminating homekit connection and New homekit connection and saving connection state to specified MQTT. I'm running it with following parameters:

python3 homekiter.py --mqtt_host wb.286.su --mqtt_topic_prefix /custom/homekit_connected --logfile /usr/src/logs/openhab.log

In the openhab I have created following things and items:

Thing exec:command:openhab_refresh_homekit [ command="ssh -i /openhab/conf/id_rsa openhab@localhost -p 8101 bundle:refresh org.openhab.io.homekit", interval=0, autorun=false ]
@andrey-yantsen
andrey-yantsen / readme.md
Last active November 16, 2018 19:38
Автоматическое скачивание новых фильмов
@andrey-yantsen
andrey-yantsen / x.py
Last active January 9, 2017 08:10
Async bulk
class bulk:
def __init__(self, handler, size):
self.handler = handler
self.size = size
self.data = []
async def __aenter__(self):
return self
async def flush(self):
{
"took": 355,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 692653,
{
"amenities_v2": [
{
"name": "Parking",
"category": "Hotel"
},
{
"name": "Business centre",
"category": "Hotel"
},

Keybase proof

I hereby claim:

  • I am andrey-yantsen on github.
  • I am virus (https://keybase.io/virus) on keybase.
  • I have a public key whose fingerprint is 013E 3083 3FFC 9B42 28CC 93E0 EB60 FFE9 E18C 297F

To claim this, I am signing this object: