This repository has been archived by the owner on Oct 1, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stephan Dilly
committed
Jan 1, 2017
1 parent
be83355
commit c685db1
Showing
3 changed files
with
176 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.dub | ||
docs.json | ||
__dummy.html | ||
*.o | ||
*.obj | ||
__test__*__ |
This file contains 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
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" |
This file contains 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
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); | ||
} |