Skip to content
This repository has been archived by the owner on Oct 1, 2022. It is now read-only.

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Dilly committed Jan 1, 2017
1 parent be83355 commit c685db1
Show file tree
Hide file tree
Showing 3 changed files with 176 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.dub
docs.json
__dummy.html
*.o
*.obj
__test__*__
6 changes: 6 additions & 0 deletions dub.sdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name "openwebif-client-d"
description "openwebif interface written in dlang using vibe.d"
authors "Stephan Dilly, Fabian Wallentowitz"
copyright "Copyright © 2017, Stephan Dilly"
license "MIT"
dependency "vibe-d" version="~>0.7.30"
164 changes: 164 additions & 0 deletions source/openwebif/api.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
module openwebif.api;

///
struct Movie {
string fullname;
string eventname;
string filename;
string filename_stripped;
string description;
string descriptionExtended;
string tags;
long filesize;
string length;
string servicename;
string begintime;
string serviceref;
long lastseen;
long recordingtime;
}

///
struct MovieList
{
string directory;
Movie[] movies;
string[] bookmarks;
}

///
struct Subservice
{
string servicereference;
string servicename;
}

///
struct Service
{
string servicereference;
string servicename;
Subservice[] subservices;
}

///
struct ServicesList
{
bool result;
Service[] services;
}

///
struct CurrentServiceInfo
{
string name;
}
struct CurrentServiceEPG
{
string sname;
string title;
long begin_timestamp;
long now_timestamp;
string shortdesc;
string longdesc;
}

///
struct CurrentService
{
CurrentServiceInfo info;
CurrentServiceEPG now;
CurrentServiceEPG next;
}

///
struct Zap
{
string message;
bool result;
}

///
struct Vol
{
int current;
string message;
bool result;
bool ismute;
}

///
struct Timer
{
string servicename;
string name;
string realbegin;
string realend;
}

///
struct TimerList
{
Timer[] timers;
bool result;
string[] locations;
}

///
struct SleepTimer
{
string action;
int minutes;
string message;
bool enabled;
}

///
struct RecordNow
{
string message;
bool result;
}

///
struct PowerState
{
bool instandby;
bool result;
}

///
interface OpenWebifApi {

import vibe.web.rest:method;
import vibe.http.common:HTTPMethod;
import vibe.data.json;

///
MovieList movielist();
///
ServicesList getallservices();
///
CurrentService getcurrent();
///
TimerList timerlist();
///
@method(HTTPMethod.GET)
Zap zap(string sRef);
/// vol expects a string containing up (increase by 5), down (decrease by 5), set<int> (set100) or mute for toogle mute state
@method(HTTPMethod.GET)
Vol vol(string set);
///
Vol vol();
/// sleeptimer expects cmd=set|get action=standby|shutdown time=minutes 1-999 enabled=True|False
@method(HTTPMethod.GET)
SleepTimer sleeptimer(string cmd, string action, int time, string enabled);
///
@method(HTTPMethod.GET)
RecordNow recordnow();
/// powerstate expects 0 for toggle standby, 1 for deep stanbdy, 2 reboot box, 3 restart gui */
@method(HTTPMethod.GET)
PowerState powerstate(int newstate);
///
Json message(string text, int type, int timeout);
}

0 comments on commit c685db1

Please sign in to comment.