11import 'package:chopper/chopper.dart' ;
22
33import 'models/device_list.dart' ;
4+ import 'models/device_stats.dart' ;
5+ import 'models/hkr_temperature.dart' ;
6+ import 'models/percentage.dart' ;
7+ import 'models/switch_action.dart' ;
8+ import 'models/temperature.dart' ;
49
510part 'aha_service.chopper.dart' ;
611
@@ -15,34 +20,85 @@ abstract class AhaService extends ChopperService {
1520 @Get (path: '$_baseUrl =getdevicelistinfos' )
1621 Future <Response <DeviceList >> getDeviceListInfos ();
1722
23+ @Get (path: '$_baseUrl =getbasicdevicestats' )
24+ Future <Response <DeviceStats >> getBasicDeviceStats (@Query () String ain);
25+
1826 // switches
1927
20- // @Get(path: '$_baseUrl=getswitchlist')
21- // Future<Response<String>> getSwitchList();
28+ @Get (path: '$_baseUrl =getswitchlist' )
29+ Future <Response <List <String >>> getSwitchList ();
30+
31+ @Get (path: '$_baseUrl =setswitchon' )
32+ Future <Response <bool >> setSwitchOn (@Query () String ain);
33+
34+ @Get (path: '$_baseUrl =setswitchoff' )
35+ Future <Response <bool >> setSwitchOff (@Query () String ain);
36+
37+ @Get (path: '$_baseUrl =setswitchtoggle' )
38+ Future <Response <bool >> setSwitchToggle (@Query () String ain);
39+
40+ @Get (path: '$_baseUrl =getswitchstate' )
41+ Future <Response <bool ?>> getSwitchState (@Query () String ain);
42+
43+ @Get (path: '$_baseUrl =getswitchpresent' )
44+ Future <Response <bool >> getSwitchPresent (@Query () String ain);
45+
46+ /// Returns the power in mW
47+ @Get (path: '$_baseUrl =getswitchpower' )
48+ Future <Response <int ?>> getSwitchPower (@Query () String ain);
49+
50+ /// Returns the energy in Wh
51+ @Get (path: '$_baseUrl =getswitchenergy' )
52+ Future <Response <int ?>> getSwitchEnergy (@Query () String ain);
53+
54+ @Get (path: '$_baseUrl =getswitchname' )
55+ Future <Response <String >> getSwitchName (@Query () String ain);
56+
57+ // temperature sensors
58+
59+ @Get (path: '$_baseUrl =gettemperature' )
60+ Future <Response <Temperature ?>> getTemperature (@Query () String ain);
61+
62+ // thermostats
63+
64+ @Get (path: '$_baseUrl =gethkrtsoll' )
65+ Future <Response <HkrTemperature ?>> getHkrTSoll (@Query () String ain);
66+
67+ @Get (path: '$_baseUrl =gethkrkomfort' )
68+ Future <Response <HkrTemperature ?>> getHkrKomfort (@Query () String ain);
69+
70+ @Get (path: '$_baseUrl =gethkrabsenk' )
71+ Future <Response <HkrTemperature ?>> getHkrAbsenk (@Query () String ain);
2272
23- // @Get(path: '$_baseUrl=setswitchon')
24- // Future<Response<SwitchStatus>> setSwitchOn(@Query() String ain);
73+ @Get (path: '$_baseUrl =sethkrtsoll' )
74+ Future <Response <void >> setHkrTSoll (
75+ @Query () String ain,
76+ @Query ('param' ) HkrTemperature temperature,
77+ );
2578
26- // @Get(path: '$_baseUrl=setswitchoff')
27- // Future<Response<SwitchStatus>> setSwitchOff(@Query() String ain);
79+ // templates
2880
29- // @Get(path: '$_baseUrl=setswitchtoggle ')
30- // Future<Response<SwitchStatus >> setSwitchToggle(@Query() String ain );
81+ // @Get(path: '$_baseUrl=gettemplatelistinfos ')
82+ // Future<Response<dynamic >> getTemplateListInfos( );
3183
32- // @Get(path: '$_baseUrl=getswitchstate')
33- // Future<Response<Optional<SwitchStatus>>> getSwitchState(
34- // @Query() String ain,
35- // );
84+ // @Get(path: '$_baseUrl=applytemplate')
85+ // Future<Response<void>> applyTemplate(@Query() String ain);
3686
37- // @Get(path: '$_baseUrl=getswitchpresent')
38- // Future<Response<SwitchStatus>> getSwitchPresent(@Query() String ain);
87+ // simple on off
3988
40- // @Get(path: '$_baseUrl=getswitchpower')
41- // Future<Response<Optional<double>>> getSwitchPower(@Query() String ain);
89+ @Get (path: '$_baseUrl =setsimpleonoff' )
90+ Future <Response <void >> setSimpleOnOff (
91+ @Query () String ain,
92+ @Query ('onoff' ) SwitchAction onOff,
93+ );
4294
43- // @Get(path: '$_baseUrl=getswitchenergy')
44- // Future<Response<Optional<double>>> getSwitchEnergy(@Query() String ain);
95+ /// Level must be [0, 255]
96+ @Get (path: '$_baseUrl =setlevel' )
97+ Future <Response <void >> setLevel (@Query () String ain, @Query () int level);
4598
46- // @Get(path: '$_baseUrl=getswitchname')
47- // Future<Response<String>> getSwitchName(@Query() String ain);
99+ @Get (path: '$_baseUrl =setlevelpercentage' )
100+ Future <Response <void >> setLevelPercentage (
101+ @Query () String ain,
102+ @Query () Percentage level,
103+ );
48104}
0 commit comments