@kohost/api-client 1.0.0-alpha.2 → 1.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/.eslintrc.js +10 -0
  2. package/bitbucket-pipelines.yml +39 -0
  3. package/commands/Command.js +38 -0
  4. package/commands/DiscoverUsersCommand.js +21 -0
  5. package/commands/SetAlarmCommand.js +21 -0
  6. package/commands/SetCourtesyCommand.js +21 -0
  7. package/commands/SetDimmerCommand.js +21 -0
  8. package/commands/SetLockCommand.js +21 -0
  9. package/commands/SetSceneControllerCommand.js +21 -0
  10. package/commands/SetSwitchCommand.js +21 -0
  11. package/commands/SetThermostatCommand.js +21 -0
  12. package/commands/SetWindowCoveringCommand.js +21 -0
  13. package/commands/VerifyDocumentCommand.js +24 -0
  14. package/commands/index.js +25 -0
  15. package/defs/deviceTypes.js +15 -0
  16. package/defs/formalDeviceTypes.js +6 -0
  17. package/defs/http.js +7 -0
  18. package/defs/index.js +11 -0
  19. package/errors/AppError.js +8 -0
  20. package/errors/AuthenticationError.js +9 -0
  21. package/errors/AuthorizationError.js +9 -0
  22. package/errors/DeviceCommError.js +9 -0
  23. package/errors/LoginError.js +9 -0
  24. package/errors/NotFoundError.js +9 -0
  25. package/errors/RequestError.js +9 -0
  26. package/errors/SystemCommError.js +9 -0
  27. package/errors/TokenExpiredError.js +9 -0
  28. package/errors/UnprocessableRequestError.js +9 -0
  29. package/errors/ValidationError.js +9 -0
  30. package/errors/index.js +15 -0
  31. package/events/Event.js +33 -0
  32. package/events/SystemCameraUpdatedEvent.js +17 -0
  33. package/events/SystemCourtesyUpdatedEvent.js +17 -0
  34. package/events/SystemDimmerUpdatedEvent.js +17 -0
  35. package/events/SystemLockUpdatedEvent.js +17 -0
  36. package/events/SystemReservationUpdatedEvent.js +17 -0
  37. package/events/SystemSceneControllerUpdatedEvent.js +17 -0
  38. package/events/SystemSourceUpdatedEvent.js +17 -0
  39. package/events/SystemSpaceUpdatedEvent.js +17 -0
  40. package/events/SystemSwitchUpdatedEvent.js +17 -0
  41. package/events/SystemThermostatUpdatedEvent.js +17 -0
  42. package/events/SystemUserUpdatedEvent.js +17 -0
  43. package/events/SystemWindowCoveringUpdatedEvent.js +17 -0
  44. package/events/index.js +28 -0
  45. package/http/handleResponseError.js +53 -0
  46. package/http/handleResponseSuccess.js +15 -0
  47. package/http/index.js +165 -0
  48. package/index.js +19 -2
  49. package/models/acl.js +29 -0
  50. package/models/admin/customer.js +28 -0
  51. package/models/admin/property.js +28 -0
  52. package/models/alarm.js +25 -3
  53. package/models/application.js +28 -0
  54. package/models/camera.js +29 -0
  55. package/models/courtesy.js +29 -3
  56. package/models/dimmer.js +45 -3
  57. package/models/discoveredDevice.js +30 -0
  58. package/models/gateway.js +33 -3
  59. package/models/index.js +38 -1
  60. package/models/integration.js +76 -0
  61. package/models/iotGateway.js +29 -0
  62. package/models/kohost.js +95 -0
  63. package/models/lock.js +29 -3
  64. package/models/mediaSource.js +29 -0
  65. package/models/motionSensor.js +29 -0
  66. package/models/reservation.js +36 -0
  67. package/models/room.js +185 -0
  68. package/models/scene.js +28 -0
  69. package/models/sceneController.js +24 -5
  70. package/models/space.js +99 -0
  71. package/models/switch.js +29 -3
  72. package/models/thermostat.js +71 -31
  73. package/models/ticket.js +91 -0
  74. package/models/user.js +58 -0
  75. package/models/windowCovering.js +44 -5
  76. package/package.json +30 -7
  77. package/prepare.js +4 -0
  78. package/schemas/acl.json +111 -0
  79. package/schemas/admin/customer.json +32 -0
  80. package/schemas/admin/property.json +174 -0
  81. package/schemas/alarm.json +5 -5
  82. package/schemas/application.json +24 -0
  83. package/schemas/camera.json +41 -0
  84. package/schemas/courtesy.json +5 -6
  85. package/schemas/definitions/common.json +21 -0
  86. package/schemas/definitions/device.json +21 -3
  87. package/schemas/dimmer.json +8 -5
  88. package/schemas/discoveredDevice.json +43 -0
  89. package/schemas/gateway.json +45 -13
  90. package/schemas/identification.json +35 -0
  91. package/schemas/integration.json +94 -0
  92. package/schemas/iotGateway.json +29 -0
  93. package/schemas/lock.json +8 -5
  94. package/schemas/mediaSource.json +151 -0
  95. package/schemas/motionSensor.json +26 -0
  96. package/schemas/payment.json +38 -0
  97. package/schemas/reservation.json +66 -0
  98. package/schemas/room.json +138 -0
  99. package/schemas/scene.json +118 -0
  100. package/schemas/sceneController.json +9 -9
  101. package/schemas/space.json +111 -0
  102. package/schemas/switch.json +8 -5
  103. package/schemas/thermostat.json +19 -10
  104. package/schemas/ticket.json +82 -0
  105. package/schemas/user.json +124 -0
  106. package/schemas/windowCovering.json +8 -5
  107. package/tests/unit/models/space.test.js +31 -0
  108. package/tests/unit/models/thermostat.test.js +146 -0
  109. package/tests/unit/models/user.test.js +28 -0
  110. package/useCases/http.json +1098 -0
  111. package/utils/getDeviceTypes.js +7 -0
  112. package/utils/getFormalDeviceType.js +5 -0
  113. package/utils/schema.js +28 -0
  114. package/vite.config.js +22 -0
  115. package/utils/compiler.js +0 -40
package/schemas/lock.json CHANGED
@@ -6,19 +6,22 @@
6
6
  "type": "object",
7
7
  "properties": {
8
8
  "id": {
9
- "$ref": "https://api.kohost.app/schemas/v3/device.json#/definitions/id"
9
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/id"
10
10
  },
11
11
  "type": {
12
- "$ref": "https://api.kohost.app/schemas/v3/device.json#/definitions/type"
12
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/type"
13
+ },
14
+ "subType": {
15
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/subType"
13
16
  },
14
17
  "systemData": {
15
- "$ref": "https://api.kohost.app/schemas/v3/device.json#/definitions/systemData"
18
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/systemData"
16
19
  },
17
20
  "supportedNotifications": {
18
- "$ref": "https://api.kohost.app/schemas/v3/device.json#/definitions/supportedNotifications"
21
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/supportedNotifications"
19
22
  },
20
23
  "notification": {
21
- "$ref": "https://api.kohost.app/schemas/v3/device.json#/definitions/notification"
24
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/notification"
22
25
  },
23
26
  "state": {
24
27
  "type": "string",
@@ -0,0 +1,151 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "https://api.kohost.app/schemas/v3/mediaSource.json",
4
+ "title": "Media Source",
5
+ "description": "Any media source",
6
+ "type": "object",
7
+ "properties": {
8
+ "id": {
9
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/id"
10
+ },
11
+ "type": {
12
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/type"
13
+ },
14
+ "subType": {
15
+ "type": "string",
16
+ "enum": [
17
+ "tv",
18
+ "dvr",
19
+ "appleTv",
20
+ "discPlayer",
21
+ "mediaPlayer",
22
+ "uncontrolledDevice"
23
+ ]
24
+ },
25
+ "audio": {
26
+ "type": "boolean"
27
+ },
28
+ "video": {
29
+ "type": "boolean"
30
+ },
31
+ "powerFeedback": {
32
+ "type": "boolean"
33
+ },
34
+ "volumeFeedback": {
35
+ "type": "boolean"
36
+ },
37
+ "command": {
38
+ "type": ["string", "null"],
39
+ "enum": [
40
+ "mute",
41
+ "volumeUp",
42
+ "volumeDown",
43
+ "channelUp",
44
+ "channelDown",
45
+ "number0",
46
+ "number1",
47
+ "number2",
48
+ "number3",
49
+ "number4",
50
+ "number5",
51
+ "number6",
52
+ "number7",
53
+ "number8",
54
+ "number9",
55
+ "lastChannel",
56
+ "display",
57
+ "favoriteChannel",
58
+ "play",
59
+ "stop",
60
+ "pause",
61
+ "fastForward",
62
+ "rewind",
63
+ "instantReplay",
64
+ "record",
65
+ "ac3",
66
+ "pvrMenu",
67
+ "guide",
68
+ "menu",
69
+ "menuUp",
70
+ "menuDown",
71
+ "menuLeft",
72
+ "menuRight",
73
+ "pageUp",
74
+ "pageDown",
75
+ "select",
76
+ "exit",
77
+ "input",
78
+ "power",
79
+ "enterChannel",
80
+ "number10",
81
+ "number11",
82
+ "number12",
83
+ "number13",
84
+ "number14",
85
+ "number15",
86
+ "number16",
87
+ "number10Plus",
88
+ "number20Plus",
89
+ "number100",
90
+ "dash",
91
+ "threeChan",
92
+ "threeD",
93
+ "sixChan",
94
+ "a",
95
+ "add",
96
+ "alarm",
97
+ "am",
98
+ "analog",
99
+ "angle",
100
+ "antenna",
101
+ "antennaEast",
102
+ "antennaWest",
103
+ "aspect",
104
+ "audio1",
105
+ "audio2",
106
+ "audio3",
107
+ "audioDumming",
108
+ "audioLevelDown",
109
+ "audioLevelUp",
110
+ "b",
111
+ "back",
112
+ "c",
113
+ "component1",
114
+ "component2",
115
+ "component3",
116
+ "d",
117
+ "home",
118
+ "list",
119
+ "liveTv",
120
+ "discreteInputCable",
121
+ "powerOff",
122
+ "powerOn",
123
+ "setupMenu",
124
+ "skipForward",
125
+ "skipReverse",
126
+ "video1",
127
+ "video2",
128
+ "video3",
129
+ "video4",
130
+ "video5",
131
+ "details",
132
+ "hdmi1",
133
+ "hdmi2",
134
+ "hdmi3",
135
+ "cecDeviceList",
136
+ "mtsSap"
137
+ ]
138
+ },
139
+ "systemData": {
140
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/systemData"
141
+ },
142
+ "supportedNotifications": {
143
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/supportedNotifications"
144
+ },
145
+ "notification": {
146
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/notification"
147
+ }
148
+ },
149
+ "additionalProperties": false,
150
+ "required": ["id", "type", "systemData", "audio", "video"]
151
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "https://api.kohost.app/schemas/v3/motionSensor.json",
4
+ "title": "Motion Sensor",
5
+ "description": "Any smart motion sensor",
6
+ "type": "object",
7
+ "properties": {
8
+ "id": {
9
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/id"
10
+ },
11
+ "type": {
12
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/type"
13
+ },
14
+ "systemData": {
15
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/systemData"
16
+ },
17
+ "supportedNotifications": {
18
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/supportedNotifications"
19
+ },
20
+ "notification": {
21
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/notification"
22
+ }
23
+ },
24
+ "additionalProperties": false,
25
+ "required": ["id", "type", "systemData"]
26
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "https://api.kohost.app/schemas/v3/payment.json",
4
+ "title": "Payment",
5
+ "type": "object",
6
+ "required": ["type", "maskedNumber", "expires"],
7
+ "properties": {
8
+ "id": {
9
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/id"
10
+ },
11
+ "type": {
12
+ "type": "string",
13
+ "enum": [
14
+ "amex",
15
+ "visa",
16
+ "masterCard",
17
+ "discover",
18
+ "diners",
19
+ "jcb",
20
+ "applePay",
21
+ "alipay",
22
+ "chinaUnionPay"
23
+ ]
24
+ },
25
+ "maskedNumber": {
26
+ "string": "string"
27
+ },
28
+ "issued": {
29
+ "type": ["string", "null"]
30
+ },
31
+ "expires": {
32
+ "string": "string"
33
+ },
34
+ "systemData": {
35
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/systemData"
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "https://api.kohost.app/schemas/v3/reservation.json",
4
+ "title": "Reservation",
5
+ "type": "object",
6
+ "required": ["type", "status", "checkInDateTime", "checkOutDateTime"],
7
+ "properties": {
8
+ "id": {
9
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/id"
10
+ },
11
+ "primaryGuest": {
12
+ "type": "string"
13
+ },
14
+ "type": {
15
+ "type": "string"
16
+ },
17
+ "sharedGuests": {
18
+ "type": "array",
19
+ "items": {
20
+ "type": "string"
21
+ }
22
+ },
23
+ "group": {
24
+ "type": "string"
25
+ },
26
+ "status": {
27
+ "type": "string",
28
+ "enum": ["reserved", "checkedIn", "checkedOut", "cancelled", "noShow"]
29
+ },
30
+ "confirmationNumber": {
31
+ "type": "string"
32
+ },
33
+ "checkInDateTime": {
34
+ "type": ["string", "object"],
35
+ "format": "date-time"
36
+ },
37
+ "checkOutDateTime": {
38
+ "type": ["string", "object"],
39
+ "format": "date-time"
40
+ },
41
+ "adultCount": {
42
+ "type": "number",
43
+ "default": 1,
44
+ "minimum": 1
45
+ },
46
+ "childCount": {
47
+ "type": "number",
48
+ "default": 0
49
+ },
50
+ "rateSuppressed": {
51
+ "type": "boolean"
52
+ },
53
+ "payment": {
54
+ "type": "string"
55
+ },
56
+ "company": {
57
+ "type": "string"
58
+ },
59
+ "travelAgent": {
60
+ "type": "string"
61
+ },
62
+ "systemData": {
63
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/systemData"
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,138 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "https://api.kohost.app/schemas/v3/room.json",
4
+ "title": "Room",
5
+ "description": "A room represents a physical space of controllable IoT devices",
6
+ "type": "object",
7
+ "properties": {
8
+ "id": {
9
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/id"
10
+ },
11
+ "name": {
12
+ "type": "string"
13
+ },
14
+ "floor": {
15
+ "type": "string"
16
+ },
17
+ "dimmers": {
18
+ "type": "array",
19
+ "default": [],
20
+ "items": {
21
+ "$ref": "https://api.kohost.app/schemas/v3/dimmer.json"
22
+ }
23
+ },
24
+ "switches": {
25
+ "type": "array",
26
+ "default": [],
27
+ "items": {
28
+ "$ref": "https://api.kohost.app/schemas/v3/switch.json"
29
+ }
30
+ },
31
+ "thermostats": {
32
+ "type": "array",
33
+ "default": [],
34
+ "items": {
35
+ "$ref": "https://api.kohost.app/schemas/v3/thermostat.json"
36
+ }
37
+ },
38
+ "locks": {
39
+ "type": "array",
40
+ "default": [],
41
+ "items": {
42
+ "$ref": "https://api.kohost.app/schemas/v3/lock.json"
43
+ }
44
+ },
45
+ "windowCoverings": {
46
+ "type": "array",
47
+ "default": [],
48
+ "items": {
49
+ "$ref": "https://api.kohost.app/schemas/v3/windowCovering.json"
50
+ }
51
+ },
52
+ "courtesy": {
53
+ "type": "array",
54
+ "default": [],
55
+ "items": {
56
+ "$ref": "https://api.kohost.app/schemas/v3/courtesy.json"
57
+ }
58
+ },
59
+ "sceneControllers": {
60
+ "type": "array",
61
+ "default": [],
62
+ "items": {
63
+ "$ref": "https://api.kohost.app/schemas/v3/sceneController.json"
64
+ }
65
+ },
66
+ "cameras": {
67
+ "type": "array",
68
+ "default": [],
69
+ "items": {
70
+ "$ref": "https://api.kohost.app/schemas/v3/camera.json"
71
+ }
72
+ },
73
+ "sources": {
74
+ "type": "array",
75
+ "default": [],
76
+ "items": {
77
+ "$ref": "https://api.kohost.app/schemas/v3/mediaSource.json"
78
+ }
79
+ },
80
+ "motionSensors": {
81
+ "type": "array",
82
+ "default": [],
83
+ "items": {
84
+ "$ref": "https://api.kohost.app/schemas/v3/motionSensor.json"
85
+ }
86
+ },
87
+ "alarms": {
88
+ "type": "array",
89
+ "default": [],
90
+ "items": {
91
+ "$ref": "https://api.kohost.app/schemas/v3/alarm.json"
92
+ }
93
+ },
94
+ "media": {
95
+ "type": "object",
96
+ "additionalProperties": false,
97
+ "default": {
98
+ "volume": 0,
99
+ "currentSource": null
100
+ },
101
+ "properties": {
102
+ "volume": {
103
+ "type": "number",
104
+ "minimum": 0,
105
+ "maximum": 100
106
+ },
107
+ "currentSource": {
108
+ "type": ["string", "null"]
109
+ }
110
+ }
111
+ },
112
+ "scenes": {
113
+ "type": "array",
114
+ "default": [],
115
+ "items": {
116
+ "description": "A list of scene IDs for later population, or entire scene objects",
117
+ "oneOf": [
118
+ {
119
+ "$ref": "https://api.kohost.app/schemas/v3/scene.json"
120
+ },
121
+ {
122
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/id"
123
+ }
124
+ ]
125
+ }
126
+ },
127
+ "occupiedAt": {
128
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/createdAt"
129
+ },
130
+ "createdAt": {
131
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/createdAt"
132
+ },
133
+ "updatedAt": {
134
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/updatedAt"
135
+ }
136
+ },
137
+ "additionalProperties": false
138
+ }
@@ -0,0 +1,118 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "https://api.kohost.app/schemas/v3/scene.json",
4
+ "title": "Scene",
5
+ "description": "A room represents a physical space of controllable IoT devices",
6
+ "type": "object",
7
+ "properties": {
8
+ "id": {
9
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/id"
10
+ },
11
+ "name": {
12
+ "type": "string"
13
+ },
14
+ "devices": {
15
+ "type": "object",
16
+ "properties": {
17
+ "switches": {
18
+ "type": "array",
19
+ "items": {
20
+ "type": "object",
21
+ "properties": {
22
+ "id": {
23
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/id"
24
+ },
25
+ "state": {
26
+ "$ref": "https://api.kohost.app/schemas/v3/switch.json#/properties/state"
27
+ }
28
+ },
29
+ "default": []
30
+ }
31
+ },
32
+ "dimmers": {
33
+ "type": "array",
34
+ "items": {
35
+ "type": "object",
36
+ "properties": {
37
+ "id": {
38
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/id"
39
+ },
40
+ "level": {
41
+ "$ref": "https://api.kohost.app/schemas/v3/dimmer.json#/properties/level"
42
+ }
43
+ }
44
+ },
45
+ "default": []
46
+ },
47
+ "windowCoverings": {
48
+ "type": "array",
49
+ "items": {
50
+ "type": "object",
51
+ "properties": {
52
+ "id": {
53
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/id"
54
+ },
55
+ "position": {
56
+ "$ref": "https://api.kohost.app/schemas/v3/windowCovering.json#/properties/position"
57
+ }
58
+ }
59
+ },
60
+ "default": []
61
+ },
62
+ "thermostats": {
63
+ "type": "array",
64
+ "items": {
65
+ "type": "object",
66
+ "properties": {
67
+ "id": {
68
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/id"
69
+ },
70
+ "hvacMode": {
71
+ "$ref": "https://api.kohost.app/schemas/v3/thermostat.json#/properties/hvacMode"
72
+ },
73
+ "setpoints": {
74
+ "$ref": "https://api.kohost.app/schemas/v3/thermostat.json#/properties/setpoints"
75
+ },
76
+ "fanMode": {
77
+ "$ref": "https://api.kohost.app/schemas/v3/thermostat.json#/properties/fanMode"
78
+ }
79
+ }
80
+ },
81
+ "default": []
82
+ },
83
+ "media": {
84
+ "type": "array",
85
+ "items": {
86
+ "type": "object",
87
+ "properties": {
88
+ "id": {
89
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/id"
90
+ },
91
+ "volume": {
92
+ "type": "number",
93
+ "minimum": 0,
94
+ "maximum": 100
95
+ },
96
+ "commands": {
97
+ "type": "array",
98
+ "items": {
99
+ "type": "string"
100
+ }
101
+ }
102
+ }
103
+ }
104
+ }
105
+ },
106
+ "additionalProperties": false
107
+ },
108
+ "isDefault": {
109
+ "type": "boolean",
110
+ "default": false
111
+ },
112
+ "showOnUi": {
113
+ "type": "boolean",
114
+ "default": true
115
+ }
116
+ },
117
+ "additionalProperties": false
118
+ }
@@ -6,22 +6,22 @@
6
6
  "type": "object",
7
7
  "properties": {
8
8
  "id": {
9
- "$ref": "https://api.kohost.app/schemas/v3/device.json#/definitions/id"
9
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/id"
10
10
  },
11
11
  "type": {
12
- "$ref": "https://api.kohost.app/schemas/v3/device.json#/definitions/type"
12
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/type"
13
+ },
14
+ "subType": {
15
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/subType"
13
16
  },
14
17
  "systemData": {
15
- "$ref": "https://api.kohost.app/schemas/v3/device.json#/definitions/systemData"
18
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/systemData"
16
19
  },
17
20
  "supportedNotifications": {
18
- "$ref": "https://api.kohost.app/schemas/v3/device.json#/definitions/supportedNotifications"
21
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/supportedNotifications"
19
22
  },
20
23
  "notification": {
21
- "$ref": "https://api.kohost.app/schemas/v3/device.json#/definitions/notification"
22
- },
23
- "subType": {
24
- "type": ["string", "null"]
24
+ "$ref": "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/notification"
25
25
  },
26
26
  "supportedScenes": {
27
27
  "type": "array",
@@ -53,6 +53,6 @@
53
53
  "enum": ["on", "off"]
54
54
  }
55
55
  },
56
- "additionalProperties": true,
56
+ "additionalProperties": false,
57
57
  "required": ["id", "type", "systemData", "supportedScenes", "scene"]
58
58
  }