How to add custom capabitilies in Appium 2.0


I’m trying Appium 2.0 and the plugins features is just awesome. It opens a huge door to improve tests adding custom commands etc …

My question here is , is it possible to create a custom plugin which it will read some custom capabilities, and those capabilities will configure the device under test before running tests ?

Example, I need to set a property to my device:

ex :

capabilities = {
    "platformName": "Android",
    "appium:deviceName": "Mydevice",
    "appium:appPackage": "org.chromium.webview_shell",
    "appium:appActivity": ".WebViewBrowserActivity",
    "appium:automationName": "UiAutomator2",
    "custom:setAndroidID": "76931fac9dab2b36"

When we start the test, the appium plugin detects the custom capabilities and call the function “setAndroidID” inside the appium plugin to apply the value.

Do you think it’s possible to do it ?