Browse Source

Merge branch 'master' of git.notice.at:redplanet/discobert

master
Andreas Demmelbauer 5 years ago
parent
commit
ee5109c1ed
3 changed files with 122 additions and 57 deletions
  1. +11
    -8
      discobert.py
  2. +40
    -49
      lircrc
  3. +71
    -0
      remotes/Sony-RM-V33E.lircd.conf

+ 11
- 8
discobert.py View File

@@ -97,8 +97,10 @@ def setStartupDmxScene():
# a universe of zeros # a universe of zeros
cv = [0 for v in range(0, 512)] cv = [0 for v in range(0, 512)]
errorcode = [240,255,0,0,0,0] errorcode = [240,255,0,0,0,0]
scene = random.choice(dmxStartupScenes)
for index, val in enumerate(dmxUserScenes[scene]):
# get a random scene index
scene = random.choice(list(enumerate(dmxStartupScenes)))[0]
print(scene)
for index, val in enumerate(dmxStartupScenes[scene]):
cv[index] = val cv[index] = val
dev.send_multi_value(1, cv) dev.send_multi_value(1, cv)


@@ -430,6 +432,7 @@ while True:
pirstate = wiringpi.digitalRead(pin_pir) pirstate = wiringpi.digitalRead(pin_pir)
doorstate = wiringpi.digitalRead(pin_door) doorstate = wiringpi.digitalRead(pin_door)
#print('pirstate: ', pirstate) #print('pirstate: ', pirstate)
#print('doorstate: ', doorstate)


# 0 => door closed # 0 => door closed
# 1 => door open # 1 => door open
@@ -449,6 +452,8 @@ while True:




remotesignal = lirc.nextcode() remotesignal = lirc.nextcode()
#print('remotesignal: ', remotesignal)

if remotesignal: if remotesignal:
lastUsed = time.time() # user is active! lastUsed = time.time() # user is active!
inUse = True inUse = True
@@ -460,8 +465,6 @@ while True:
setWorkingMode() setWorkingMode()
if(code == "mode_power"): if(code == "mode_power"):
setOnOff() setOnOff()
#if(code == "mode_dmx_next"):

if(code == "mode_music_play_1"): if(code == "mode_music_play_1"):
startMusic('1') startMusic('1')
if(code == "mode_music_play_2"): if(code == "mode_music_play_2"):
@@ -492,13 +495,13 @@ while True:
pauseMusic() pauseMusic()
if(code == "mode_music_rewind"): if(code == "mode_music_rewind"):
seek(-30)
seek('-30')
if(code == "mode_music_back"): if(code == "mode_music_back"):
seek(-5)
seek('-5')
if(code == "mode_music_forward"): if(code == "mode_music_forward"):
seek(5)
seek('+5')
if(code == "mode_music_fastforward"): if(code == "mode_music_fastforward"):
seek(30)
seek('+30')
if(code == "mode_volume_up"): if(code == "mode_volume_up"):
changeVolume(5) changeVolume(5)


+ 40
- 49
lircrc View File

@@ -1,31 +1,45 @@
begin
button = KEY_STARTPHONO
prog = disco
config = mode_disco
end

begin
button = KEY_STOPPHONO
prog = disco
config = mode_work
end

begin
button = KEY_TAPE
prog = disco
config = mode_power
end

begin begin
button = KEY_1 button = KEY_1
prog = disco prog = disco
config = mode_music_play_1 config = mode_music_play_1
end end



begin begin
button = KEY_2 button = KEY_2
prog = disco prog = disco
config = mode_music_play_2 config = mode_music_play_2
end end



begin begin
button = KEY_3 button = KEY_3
prog = disco prog = disco
config = mode_music_play_3 config = mode_music_play_3
end end



begin begin
button = KEY_4 button = KEY_4
prog = disco prog = disco
config = mode_music_play_4 config = mode_music_play_4
end end



begin begin
button = KEY_5 button = KEY_5
prog = disco prog = disco
@@ -38,25 +52,7 @@ begin
config = mode_music_stop config = mode_music_stop
end end


begin
button = KEY_MUTE
prog = disco
config = mode_music_mute
end

begin
button = KEY_VOLUMEUP
prog = disco
repeat = 2
config = mode_volume_up
end


begin
button = KEY_VOLUMEDOWN
prog = disco
repeat = 2
config = mode_volume_down
end


begin begin
button = KEY_CD button = KEY_CD
@@ -77,22 +73,11 @@ begin
config = mode_play_oe1 config = mode_play_oe1
end end


begin
button = BTN_START
prog = disco
config = mode_disco
end

begin
button = KEY_STOP
prog = disco
config = mode_work
end


begin begin
button = KEY_STOPCD button = KEY_STOPCD
prog = disco prog = disco
config = mode_work
config = mode_music_stop
end end


begin begin
@@ -114,15 +99,9 @@ begin
end end


begin begin
button = KEY_FORWARD
prog = disco
config = mode_music_forward
end

begin
button = KEY_FASTFORWARD
button = KEY_REWIND
prog = disco prog = disco
config = mode_music_fastforward
config = mode_music_rewind
end end


begin begin
@@ -132,16 +111,15 @@ begin
end end


begin begin
button = KEY_REWIND
button = KEY_FORWARD
prog = disco prog = disco
config = mode_music_rewind
config = mode_music_forward
end end



begin begin
button = KEY_REWIND
button = KEY_FASTFORWARD
prog = disco prog = disco
config = mode_music_rewind
config = mode_music_fastforward
end end


begin begin
@@ -156,9 +134,22 @@ begin
config = mode_music_previous config = mode_music_previous
end end


begin
button = KEY_VOLUMEUP
prog = disco
repeat = 2
config = mode_volume_up
end


begin begin
button = KEY_POWER
button = KEY_VOLUMEDOWN
prog = disco prog = disco
config = mode_power
repeat = 2
config = mode_volume_down
end

begin
button = KEY_MUTE
prog = disco
config = mode_music_mute
end end

+ 71
- 0
remotes/Sony-RM-V33E.lircd.conf View File

@@ -0,0 +1,71 @@

# Please take the time to finish this file as described in
# https://sourceforge.net/p/lirc-remotes/wiki/Checklist/
# and make it available to others by sending it to
# <lirc@bartelmus.de>
#
# This config file was automatically generated
# using lirc-0.9.4c(default) on Tue Apr 16 15:31:07 2019
# Command line used: -u ./Sony-RM-V33E.lircd.conf
# Kernel version (uname -r): 4.14.98-v7+
#
# Remote name (as of config file): Sony-RM-V33E
# Brand of remote device, the thing you hold in your hand:
# Remote device model nr: Sony RM-V33E
# Remote device info url:
# Does remote device has a bundled capture device e. g., a
# usb dongle? : no
# For bundled USB devices: usb vendor id, product id
# and device string (use dmesg or lsusb):
# Type of device controlled
# (TV, VCR, Audio, DVD, Satellite, Cable, HTPC, ...) :
# Device(s) controlled by this remote: Audio

begin remote

name Sony-RM-V33E
bits 8
flags SPACE_ENC|CONST_LENGTH
eps 30
aeps 100

header 2441 578
one 1230 578
zero 629 578
post_data_bits 4
post_data 0x1
gap 45269
toggle_bit_mask 0x0
frequency 38000

begin codes
KEY_STARTPHONO 0x14
KEY_STOPPHONO 0x94
KEY_TAPE 0xF0
KEY_1 0x00
KEY_2 0x80
KEY_3 0x40
KEY_4 0xC0
KEY_5 0x20
KEY_REWIND 0xCC
KEY_BACK 0xEC
KEY_FORWARD 0x4C
KEY_FASTFORWARD 0x2C
KEY_STOP 0x1C
KEY_PAUSE 0x9C
KEY_RECORD 0xFC
KEY_PLAY 0x4D
KEY_PREVIOUS 0x0D
KEY_NEXT 0x8D
KEY_STOPCD 0x1D
KEY_CD 0xA4
KEY_VCR2 0x78
KEY_VCR 0x44
KEY_VOLUMEUP 0x48
KEY_VOLUMEDOWN 0xC8
KEY_MUTE 0x28
end codes

end remote



Loading…
Cancel
Save