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
n = 1 | |
t = 0 | |
doubling_time = 2.4 | |
days = 60 | |
while True: | |
n *= 2 | |
t += doubling_time | |
print(f'day={t} n={n}') | |
if t > days: |
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
# /start command handler | |
event.hook.OnTelegramStartCmd: | |
if: | |
type: platypush.message.event.chat.telegram.CommandMessageEvent | |
command: start | |
then: | |
- action: chat.telegram.send_message | |
args: | |
chat_id: ${chat_id} | |
text: "Welcome! Type /help to see the available commands" |
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
# Hue lights configuration | |
light.hue: | |
# Hue bridge IP address | |
bridge: 192.168.1.10 | |
# Default groups to control | |
groups: | |
- Living Room | |
# MPD/Mopidy configuration |
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
chat.telegram: | |
api_token: <your bot token> | |
backend.chat.telegram: | |
enabled: true | |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Play the music when you say "play the music". | |
# Note the regex support: this hook will be triggered whether you | |
# say "play the music" or "play music". | |
event.hook.PlayMusicAssistantCommand: | |
if: | |
type: platypush.message.event.assistant.SpeechRecognizedEvent | |
phrase: "play (the)? music" | |
then: | |
- action: music.mpd.play |
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
event.hook.OnSensorData: | |
if: | |
type: platypush.message.event.sensor.SensorDataChangeEvent | |
then: | |
- if ${data.get('ir') == 'code1'}: | |
- action: music.mpd.play | |
- if ${data.get('ir') == 'code2'}: | |
- action: music.mpd.pause | |
- if ${data.get('ir') == 'code3'}: | |
- action: music.mpd.stop |
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
#include <IRremote.h> | |
#define IR_REPEAT 0xFFFFFFFF | |
const int RECV_PIN = 2; | |
IRrecv irrecv(RECV_PIN); | |
decode_results results; | |
unsigned int latest_value = 0; |