16 KiB
mycore_api.api.DeviceApi
Load the API package
import 'package:mycore_api/api.dart';
All URIs are relative to https://localhost:5001
| Method | HTTP request | Description |
|---|---|---|
| deviceCreate | POST /api/device | Create a device |
| deviceCreateDevicesFromProvider | POST /api/device/{homeId}/fromProvider/{providerId} | Create devices from provider |
| deviceDelete | DELETE /api/device/{deviceId} | Delete a device |
| deviceDeleteAllForHome | DELETE /api/device/home/{homeId} | Delete all device for a specified home |
| deviceDeleteDevicesFromProvider | DELETE /api/device/{homeId}/fromProvider/{providerId} | Delete devices from provider |
| deviceGetAll | GET /api/device/{homeId} | Get all devices summary |
| deviceGetDetail | GET /api/device/detail/{deviceId} | Get a specific device info |
| deviceGetDevicesByType | GET /api/device/{homeId}/type/{type} | Get list of devices from a type |
| deviceGetDevicesFromProvider | GET /api/device/{homeId}/fromProvider/{providerId} | Get devices from provider |
| deviceGetDevicesFromZigbee2Mqtt | GET /api/device/zigbee2Mqtt/{homeId} | Get all zigbee2Mqtt devices |
| deviceSendAction | POST /api/device/action | Send action to device |
| deviceUpdate | PUT /api/device/{deviceId} | Update a device |
deviceCreate
DeviceDetailDTO deviceCreate(deviceDetailDTO)
Create a device
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO | Device to create
try {
final result = api_instance.deviceCreate(deviceDetailDTO);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceCreate: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceDetailDTO | DeviceDetailDTO | Device to create |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceCreateDevicesFromProvider
List deviceCreateDevicesFromProvider(homeId, providerId)
Create devices from provider
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final homeId = homeId_example; // String | Home Id
final providerId = providerId_example; // String | Id of Provider
try {
final result = api_instance.deviceCreateDevicesFromProvider(homeId, providerId);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceCreateDevicesFromProvider: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| homeId | String | Home Id | |
| providerId | String | Id of Provider |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceDelete
String deviceDelete(deviceId)
Delete a device
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final deviceId = deviceId_example; // String | Id of device to delete
try {
final result = api_instance.deviceDelete(deviceId);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceDelete: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | String | Id of device to delete |
Return type
String
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceDeleteAllForHome
String deviceDeleteAllForHome(homeId)
Delete all device for a specified home
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final homeId = homeId_example; // String | Id of home
try {
final result = api_instance.deviceDeleteAllForHome(homeId);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceDeleteAllForHome: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| homeId | String | Id of home |
Return type
String
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceDeleteDevicesFromProvider
String deviceDeleteDevicesFromProvider(homeId, providerId)
Delete devices from provider
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final homeId = homeId_example; // String | Home Id
final providerId = providerId_example; // String | Id of Provider
try {
final result = api_instance.deviceDeleteDevicesFromProvider(homeId, providerId);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceDeleteDevicesFromProvider: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| homeId | String | Home Id | |
| providerId | String | Id of Provider |
Return type
String
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceGetAll
List deviceGetAll(homeId)
Get all devices summary
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final homeId = homeId_example; // String | Home Id
try {
final result = api_instance.deviceGetAll(homeId);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceGetAll: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| homeId | String | Home Id |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceGetDetail
DeviceDetailDTO deviceGetDetail(deviceId)
Get a specific device info
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final deviceId = deviceId_example; // String | id of device
try {
final result = api_instance.deviceGetDetail(deviceId);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceGetDetail: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | String | id of device |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceGetDevicesByType
List deviceGetDevicesByType(homeId, type)
Get list of devices from a type
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final homeId = homeId_example; // String | Home Id
final type = ; // DeviceType | device type
try {
final result = api_instance.deviceGetDevicesByType(homeId, type);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceGetDevicesByType: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| homeId | String | Home Id | |
| type | DeviceType | device type |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceGetDevicesFromProvider
List deviceGetDevicesFromProvider(homeId, providerId)
Get devices from provider
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final homeId = homeId_example; // String | Home Id
final providerId = providerId_example; // String | Id of Provider
try {
final result = api_instance.deviceGetDevicesFromProvider(homeId, providerId);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceGetDevicesFromProvider: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| homeId | String | Home Id | |
| providerId | String | Id of Provider |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceGetDevicesFromZigbee2Mqtt
List deviceGetDevicesFromZigbee2Mqtt(homeId)
Get all zigbee2Mqtt devices
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final homeId = homeId_example; // String | Home Id
try {
final result = api_instance.deviceGetDevicesFromZigbee2Mqtt(homeId);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceGetDevicesFromZigbee2Mqtt: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| homeId | String | Home Id |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceSendAction
String deviceSendAction(action)
Send action to device
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final action = Action(); // Action | Action to sent
try {
final result = api_instance.deviceSendAction(action);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceSendAction: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| action | Action | Action to sent |
Return type
String
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceUpdate
DeviceDetailDTO deviceUpdate(deviceId, deviceDetailDTO)
Update a device
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final deviceId = deviceId_example; // String |
final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO | Device to update
try {
final result = api_instance.deviceUpdate(deviceId, deviceDetailDTO);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceUpdate: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | String | ||
| deviceDetailDTO | DeviceDetailDTO | Device to update |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]