Folgende Warnungen sind aufgetreten:
Warning [2] Undefined variable $unreadreports - Line: 34 - File: global.php(961) : eval()'d code PHP 8.2.24 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/global.php(961) : eval()'d code 34 errorHandler->error_callback
/global.php 961 eval
/showthread.php 28 require_once
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 43 - File: showthread.php(1621) : eval()'d code PHP 8.2.24 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1621) : eval()'d code 43 errorHandler->error_callback
/showthread.php 1621 eval




Themabewertung:
  • 5 Bewertung(en) - 5 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
Diskussionsthread - CarPi/CarPC Image 2016 (Raspbian Jessie, Kodi 15.2)
so ist das script etwas kürzer.

Code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import socket
import time

UDP_IP = "127.0.0.1"
UDP_PORT = 5005

LOOP_COUNT = 14

def main():
    time.sleep(10)  # wait for ... ?
    
    # Path to stations preset file
    with open('/home/pi/.kodi/addons/plugin.program.radioFM/resources/stations','r') as file:
        # Read the stations file into string and close it
        data = file.readlines()
    
    
    # Take first line from station list and split it up by spaces
    item = data[0]
    requestedFrequency = item.split(' ')
    # Use the first value of the split string for first station to tune radio to
    
    sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    sock.sendto("radio_tune_" + requestedFrequency[0] + "\0", (UDP_IP, UDP_PORT))
    for _ in range(LOOP_COUNT):
        sock.sendto("radio_volume_plus", (UDP_IP, UDP_PORT))
    
    sock.close()

if __name__ == '__main__':
    main()


Nachrichten in diesem Thema
RE: Diskussionsthread - CarPi/CarPC Image 2016 (Raspbian Jessie, Kodi 15.2) - von harryberlin - 29.12.2016, 16:36

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 17 Gast/Gäste
RasPiCarProjekt