This file contains 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
""" | |
Based on incredible works: | |
* @mildsunrise (https://gist.github.com/mildsunrise/1d576669b63a260d2cff35fda63ec0b5) | |
* @elupus (https://github.com/elupus/irgen) | |
(thank you!) | |
Script to convert Broadlink base64 encoded remote codes into a format that can be used in Tuya's IR Blasters (ZS06, ZS08, TS1201, UFO-R11). | |
**Usage:** | |
python3 broadlink_to_tuya.py <broadlink_base64_encoded_string> |
This file contains 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
require 'liquid' | |
require 'uri' | |
# Percent encoding for URI conforming to RFC 3986. | |
# Ref: http://tools.ietf.org/html/rfc3986#page-12 | |
module URLEncoding | |
def url_encode(url) | |
return URI.escape(url, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]")) | |
end | |
end |