alias: 3D Drucker auf fertig setzen
description: ""
triggers:
- trigger: state
entity_id:
- sensor.prusaprinter
from: busy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class EnumHelper { | |
| /** check if the enum contains the value (case-insensitive) */ | |
| static hasEnumValue<T>(enumObject: T, enumValue: string): boolean { | |
| const hasEnumValue = Object.values(enumObject) | |
| .map((v) => v.toString().toLowerCase()) | |
| .includes(enumValue?.toLowerCase()); | |
| return hasEnumValue; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export interface HasId { | |
| id: string; | |
| } | |
| export interface HasOrderIndex { | |
| orderIndex: number; | |
| } | |
| export interface Dictionary<T extends HasId> { | |
| [id: string]: T; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from imapclient import IMAPClient, DELETED | |
| import datetime | |
| SERVER = 'imap.yourdomain.com' | |
| USERNAME = 'mail' | |
| PASSWORD = '1234567890' | |
| FOLDER = 'INBOX' | |
| MAX_DAYS = 90 # emails older than was deleted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "id": "6a823385.834cbc", | |
| "type": "tab", | |
| "label": "AWTRIX", | |
| "disabled": false, | |
| "info": "" | |
| }, | |
| { | |
| "id": "91c2dade.0c6518", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import RPi.GPIO as GPIO | |
| import os | |
| BUTTON_PIN = 14 | |
| GPIO.setmode(GPIO.BCM) | |
| GPIO.setup(BUTTON_PIN, GPIO.IN) | |
| try: | |
| channel = GPIO.wait_for_edge(BUTTON_PIN, GPIO.RISING) |