- Download script
- Install mqtt-wrapper
pip install mqtt-wrapper
- Open OBS Studio
- In OBS Studio add a script (Tools -> Scripts)
- Configure script parameters (my base channel is homeassistant and my sensor name is obs, creating the path homeassistant/sensor/obs)
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
# -*- coding: utf-8 -*- | |
"""Configuration class storing data as jsonfile. | |
Written for micropython which has no configparser module, but can be | |
used on regular python as well. The goal is to make a configuration class | |
that is simpler and less painful to use than ConfigParser.""" | |
try: | |
# micropython module | |
import ujson as json | |
except ImportError: |
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 click | |
def edit(text=''): | |
"""Use nano as a preferred editor with autosave on exit | |
(easier on the user). | |
If nano is not available (e.g. on Windows), | |
use any editor found on the system""" | |
try: | |
edited_text = click.edit(text, editor='nano -t', require_save=False) | |
except click.ClickException: | |
edited_text = click.edit(text, require_save=False) |
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/env python3 | |
"""Database fix for rpi2caster 0.4: | |
layout was: [(char1, [style1, style2...], column1, row1, units1), | |
(char2, [style1, style2...], column2, row2, units2),...] | |
now is: [(char1, styles1, coords1, units1), | |
(char2, styles2, coords2, units2),...] | |
(simplified the styles and coordinates) | |
""" | |
from rpi2caster import database | |
DB = database.Database() |
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/env python3 | |
import os | |
from rpi2caster import database | |
from rpi2caster import matrix_data | |
DB = database.Database() | |
def correct_diecases(): |
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/python | |
class Foo(object): | |
def __init__(self): | |
print('Initializing Foo') | |
def __enter__(self): | |
print('Entering Foo context') | |
return self | |
def __exit__(self, *args): | |
print('Exiting Foo context') | |
def Foomethod(self): |
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
/* Demonstration C GPIO interrupt handling routine for Raspberry Pi | |
This is a modified code found at https://github.com/phil-lavin/raspberry-pi-gpio-interrupt | |
The program displays a notice whenever you: | |
-turn on the Raspberry Pi's pin 11 (apply 3.3V), | |
-turn the pin off. | |
This routine uses wiringPi library (follow the installation instructions at wiringpi.com), | |
and should be compiled with a command: |