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
| // tuya-ir.ts | |
| // TypeScript implementation of Tuya IR timings decoder and encoder. | |
| // Based on: https://gist.github.com/jbouwh/c5aaaad803d3883c0b57e7827529a153 | |
| type Timing = number; | |
| /** Cross-environment base64 decode to Uint8Array */ | |
| function base64ToBytes(b64: string): Uint8Array { | |
| const globalAny: any = (typeof globalThis !== "undefined" ? globalThis : (typeof window !== "undefined" ? window : {})); | |
| const Buf = globalAny.Buffer; |
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
| """Decode/Encode Tuya base64 format to be used with Home Assistant.""" | |
| from base64 import b64decode, b64encode | |
| import logging | |
| from struct import pack, unpack | |
| _LOGGER = logging.getLogger(__name__) | |
| def decode_tuya_timings(b64_string: str) -> list[int] | None: |
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
| --- | |
| blueprint: | |
| name: Z2M - IKEA styrbar (4 button)/Tradfi (On/Off) remote for lights | |
| description: | | |
| Control lights with a: | |
| - IKEA styrbar (4 button) remote [E2001/E2002](https://www.zigbee2mqtt.io/devices/E2001_E2002.html#ikea-e2001%252Fe2002). | |
| - TRADFRI on/off switch [E1743](https://www.zigbee2mqtt.io/devices/E1743.html#ikea-e1743). | |
| There are 3 different features: | |
| - Turn the light group on or off |
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
| """Script to test the subscribing performance with device based discovery. | |
| See: https://github.com/home-assistant/core/pull/109030 | |
| Test script to to assert the HomeAssistant MQTT discovery. | |
| """ | |
| import copy | |
| import json | |
| import sys |
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
| #! /usr/bin/python3 | |
| """Postfix hold queue clean up tool.""" | |
| from datetime import datetime, timedelta | |
| import json | |
| from pathlib import Path | |
| import subprocess | |
| import logging | |
| import os | |
| import smtplib |
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
| #! /usr/bin/bash | |
| sudo docker run -it --rm --name="certbot" \ | |
| --mount type=bind,source=/etc/letsencrypt,target="/etc/letsencrypt" \ | |
| --mount type=bind,source=/var/log/letsencrypt,target="/opt/certbot-dns-transip/logs" \ | |
| --mount type=bind,source=/etc/transip,target="/opt/certbot-dns-transip/config" \ | |
| rbongers/certbot-dns-transip certonly --reuse-key \ | |
| --manual --preferred-challenges=dns --manual-auth-hook /opt/certbot-dns-transip/auth-hook \ | |
| --manual-cleanup-hook /opt/certbot-dns-transip/cleanup-hook \ | |
| --cert-name certname.example.com \ | |
| -d '*.example.com' \ |
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
| """The tests for MQTT subscribing performance. | |
| Test script to to assert the HomeAssistant MQTT discovery. | |
| """ | |
| import copy | |
| import json | |
| import sys | |
| from typing import Any | |
| from time import sleep |
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
| """Process DMARC report mail items from an MS365 online mail folder via the GRAPH API using app_id and secret. | |
| fill config template below and save this in `config.cfg` (same folder) | |
| [graph-dmarc-mail] | |
| clientId = xxxxx | |
| clientSecret = xxxxx | |
| tenantId = xxxxx | |
| mailbox = something@example.com |
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
| #!/bin/bash | |
| # Cache sudo password | |
| sudo -v | |
| # Get latest OpenSSL 1.0.2 version from https://openssl.org/source/ | |
| # v1.1.0 seems to have removed SSLv2/3 support | |
| openssl_version=1.0.2k | |
| # Install perl modules, makedepends and gcc and build dependencies |
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
| """The tests for the Select component.""" | |
| from unittest.mock import MagicMock | |
| import pytest | |
| from homeassistant.components.select import ( | |
| ATTR_OPTION, | |
| ATTR_OPTIONS, | |
| SelectEntity, | |
| DOMAIN, |
NewerOlder