Closed galadril closed 3 years ago
I cant continue on this feature, because i cant test this on emulators.. I don't own an Android 11 devices yet....
See this issue on Google: https://issuetracker.google.com/issues/168973367
Would be working on this feature on this branch https://github.com/domoticz/domoticz-android/tree/external-control-menu
Working on the new feature!!
@ofalvai I have a question for you on implementing the new External Controls Service.
Im trying to implement this, but im sometimes loosing controls when adding them to the list of controls for the power menu: https://www.youtube.com/watch?v=JQ7whWCnnSo
As you can see on the video, the last control that i added disappeared right after closing and opening the control center. There are no errors whatsoever in the logs.. It also shows that the newly added control was removed:
ControlsProviderService: Creating publishers for 4
ControlsProviderService: Adding stateful for device: Woonkamer Lampen | with control id 3002
ControlsProviderService: Adding stateful for device: Keuken Lampen | with control id 3003
ControlsProviderService: Adding stateful for device: Lampen | with control id 3005
ControlsProviderService: Adding stateful for device: Spot 1 (Bank) | with control id 1655
ControlsProviderService: Done processing
ControlsProviderService: Creating publishers for 3
ControlsProviderService: Adding stateful for device: Woonkamer Lampen | with control id 3002
ControlsProviderService: Adding stateful for device: Keuken Lampen | with control id 3003
ControlsProviderService: Adding stateful for device: Lampen | with control id 3005
ControlsProviderService: Done processing
This is the control service: https://github.com/domoticz/domoticz-android/blob/external-control-menu/app/src/main/java/nl/hnogames/domoticz/service/CustomControlService.java
I dont know if you also encountered this issue?? And maybe solved it??
Now in beta!
Finally implemented this new feature
The Quick Access Device Controls feature, available starting in Android 11, allows the user to quickly view and control external devices such as lights, thermostats, and cameras from the Android power menu. Device aggregators (for example, Google Home) and third-party vendor apps can provide devices for display in this space. This guide shows you how to add support for device controls to your control app.
To add this support, create and declare a ControlsProviderService, create the controls your app supports based on predefined control types, and then create publishers for these controls.
https://www.androidcentral.com/android-11-heres-whats-new-power-menu-and-device-controls https://developer.android.com/preview/features/device-control