Skip to content

Commit 538923f

Browse files
committed
add API docs
1 parent c4e677a commit 538923f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+969
-138
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI/CD
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
pull_request:
7+
8+
jobs:
9+
ci:
10+
name: CI
11+
uses: Skycoder42/dart_test_tools/.github/workflows/dart.yml@main
12+
with:
13+
buildRunner: true
14+
unitTestPaths: ""
15+
16+
# cd:
17+
# name: CD
18+
# uses: Skycoder42/dart_test_tools/.github/workflows/publish.yml@main
19+
# needs:
20+
# - ci
21+
# with:
22+
# buildRunner: true
23+
# secrets:
24+
# PUB_DEV_CREDENTIALS: ${{ secrets.PUB_DEV_CREDENTIALS }}
File renamed without changes.

analysis_options.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,3 @@ analyzer:
55
- "**/*.g.dart"
66
- "**/*.chopper.dart"
77
- "**/*.freezed.dart"
8-
9-
linter:
10-
rules:
11-
public_member_api_docs: false

doc/.pubignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/aha_client.dart

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,51 @@
1+
export 'src/api/aha/aha_service.dart';
2+
export 'src/api/aha/models/alert.dart';
3+
export 'src/api/aha/models/avm_button.dart';
4+
export 'src/api/aha/models/blind_state.dart';
5+
export 'src/api/aha/models/button.dart';
6+
export 'src/api/aha/models/color.dart';
7+
export 'src/api/aha/models/color_control.dart';
8+
export 'src/api/aha/models/color_defaults.dart';
9+
export 'src/api/aha/models/device.dart';
10+
export 'src/api/aha/models/device_list.dart';
11+
export 'src/api/aha/models/device_stats.dart';
12+
export 'src/api/aha/models/energy.dart';
13+
export 'src/api/aha/models/function_bit_mask.dart';
14+
export 'src/api/aha/models/group_info.dart';
15+
export 'src/api/aha/models/hkr.dart';
16+
export 'src/api/aha/models/hkr_temperature.dart';
17+
export 'src/api/aha/models/hs_color.dart';
18+
export 'src/api/aha/models/hs_defaults.dart';
19+
export 'src/api/aha/models/level.dart';
20+
export 'src/api/aha/models/level_control.dart';
21+
export 'src/api/aha/models/name.dart';
22+
export 'src/api/aha/models/next_change.dart';
23+
export 'src/api/aha/models/percentage.dart';
24+
export 'src/api/aha/models/power.dart';
25+
export 'src/api/aha/models/power_meter.dart';
26+
export 'src/api/aha/models/simple_on_off.dart';
27+
export 'src/api/aha/models/stats.dart' hide StatsUnit;
28+
export 'src/api/aha/models/stats_group.dart';
29+
export 'src/api/aha/models/subscription_state.dart';
30+
export 'src/api/aha/models/switch.dart';
31+
export 'src/api/aha/models/switch_action.dart';
32+
export 'src/api/aha/models/switch_duration.dart';
33+
export 'src/api/aha/models/switch_state.dart';
34+
export 'src/api/aha/models/temp.dart';
35+
export 'src/api/aha/models/temperature.dart';
36+
export 'src/api/aha/models/temperature_defaults.dart';
37+
export 'src/api/aha/models/timestamp.dart';
38+
export 'src/api/aha/models/voltage.dart';
139

40+
export 'src/api/aha_client.dart';
41+
42+
export 'src/api/login/authentication_exception.dart';
43+
export 'src/api/login/login_info.dart';
44+
export 'src/api/login/login_manager.dart';
45+
export 'src/api/login/models/right.dart';
46+
export 'src/api/login/models/sid.dart';
47+
export 'src/api/login/models/user.dart';
48+
export 'src/api/login/user_credentials.dart';
49+
50+
export 'src/api/util/text_converter.dart' show UnexpectedNullableResponse;
51+
export 'src/api/util/xml_converter.dart' show InvalidRootElement;

lib/src/api/aha/aha_exception.dart

Lines changed: 0 additions & 26 deletions
This file was deleted.

lib/src/api/aha/aha_service.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
// ignore_for_file: public_member_api_docs
2+
13
import 'package:chopper/chopper.dart';
24
import 'package:color/color.dart';
5+
import 'package:meta/meta.dart';
36

47
import 'models/blind_state.dart';
58
import 'models/color_defaults.dart';
@@ -23,6 +26,8 @@ part 'aha_service.chopper.dart';
2326
abstract class AhaService extends ChopperService {
2427
static const _baseUrl = '/webservices/homeautoswitch.lua?switchcmd';
2528

29+
/// @nodoc
30+
@internal
2631
static AhaService create([ChopperClient? client]) => _$AhaService(client);
2732

2833
// all devices / global
@@ -158,6 +163,7 @@ abstract class AhaService extends ChopperService {
158163
) =>
159164
setLevel(
160165
ain,
166+
// ignore: invalid_use_of_visible_for_overriding_member
161167
Percentage(rawValue: color.v.round()).toLevel(),
162168
);
163169

lib/src/api/aha/models/alert.dart

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,54 @@ import 'timestamp.dart';
88
part 'alert.freezed.dart';
99
part 'alert.g.dart';
1010

11+
/// The state of an alert device.
12+
///
13+
/// {@macro aha_reference}
1114
@xml.XmlEnum()
1215
enum AlertState {
1316
@xml.XmlValue('0')
17+
// ignore: public_member_api_docs
1418
ok(false),
19+
1520
@xml.XmlValue('1')
21+
// ignore: public_member_api_docs
1622
alertOrBlocked(true),
23+
1724
@xml.XmlValue('2')
25+
// ignore: public_member_api_docs
1826
overheated(true),
27+
1928
@xml.XmlValue('3')
29+
// ignore: public_member_api_docs
2030
blockedAndOverheated(true),
31+
2132
@xml.XmlValue('')
33+
// ignore: public_member_api_docs
2234
unknown(null);
2335

36+
/// Checks if the current value is an alert or not.
37+
///
38+
/// Can be null if the alert state is unknown.
2439
final bool? hasAlert;
2540

41+
/// @nodoc
42+
@internal
2643
// ignore: avoid_positional_boolean_parameters
2744
const AlertState(this.hasAlert);
2845
}
2946

47+
/// Status information about an alert device
48+
///
49+
/// {@macro aha_reference}
3050
@Freezed(makeCollectionsUnmodifiable: false)
3151
@xml.XmlSerializable()
3252
abstract class Alert with _$Alert implements IXmlSerializable {
53+
/// @nodoc
54+
@internal
3355
static const invalid = Alert();
3456

57+
/// @nodoc
58+
@internal
3559
@xml.XmlSerializable(createMixin: true)
3660
@With.fromString(r'_$_$_AlertXmlSerializableMixin')
3761
const factory Alert({
@@ -41,6 +65,8 @@ abstract class Alert with _$Alert implements IXmlSerializable {
4165
Timestamp lastAlertChgTimestamp,
4266
}) = _Alert;
4367

68+
/// @nodoc
69+
@internal
4470
factory Alert.fromXmlElement(XmlElement element) =>
4571
_$_$_AlertFromXmlElement(element);
4672
}

lib/src/api/aha/models/avm_button.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,26 @@ import 'percentage.dart';
88
part 'avm_button.freezed.dart';
99
part 'avm_button.g.dart';
1010

11+
/// Status information about an avm button device
12+
///
13+
/// {@macro aha_reference}
1114
@Freezed(makeCollectionsUnmodifiable: false)
1215
@xml.XmlSerializable()
1316
abstract class AvmButton with _$AvmButton implements IXmlSerializable {
17+
/// @nodoc
18+
@internal
1419
static const invalid = AvmButton();
1520

21+
/// @nodoc
22+
@internal
1623
@xml.XmlSerializable(createMixin: true)
1724
@With.fromString(r'_$_$_AvmButtonXmlSerializableMixin')
1825
const factory AvmButton({
1926
@xml.XmlElement() @Default(Percentage.invalid) Percentage humidity,
2027
}) = _AvmButton;
2128

29+
/// @nodoc
30+
@internal
2231
factory AvmButton.fromXmlElement(XmlElement element) =>
2332
_$_$_AvmButtonFromXmlElement(element);
2433
}

lib/src/api/aha/models/blind_state.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
// ignore_for_file: public_member_api_docs
2+
3+
/// The state of a blinds device.
4+
///
5+
/// {@macro aha_reference}
6+
17
enum BlindState {
28
open,
9+
310
close,
11+
412
stop;
513

614
@override

0 commit comments

Comments
 (0)