initial commit

This commit is contained in:
hmrhkr committed 2023-07-25 02:45:49 +02:00
1 parent 80571fa781
commit 179e543fee
12 files changed
+298 -1

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
import asyncio
from pyartnet import ArtNetNode
async def main():
# Run this code in your async function
node = ArtNetNode('127.0.0.1', 6454)
# Create universe 0
universe = node.add_universe(0)
# Add a channel to the universe which consists of 3 values
# Default size of a value is 8Bit (0..255) so this would fill
# the DMX values 1..3 of the universe
channel = universe.add_channel(start=12, width=3)
channel2 = universe.add_channel(start=15, width=3)
# Fade channel to 255,0,0 in 5s
# The fade will automatically run in the background
channel.add_fade([3,2,1], 500)
channel2.add_fade([1,2,3], 500)
#channel.set_values([255,0,127])
# this can be used to wait till the fade is complete
await channel
asyncio.run(main())
+7
View File
@@ -0,0 +1,7 @@
import requests
json_data = {'dmx': [3,7,1,0,3,4]}
response = requests.post('http://127.0.0.1:8081/dmx', json = json_data)
if response.status_code == 200:
print('Success!')