• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java PowerControl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.connectsdk.service.capability.PowerControl的典型用法代码示例。如果您正苦于以下问题:Java PowerControl类的具体用法?Java PowerControl怎么用?Java PowerControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PowerControl类属于com.connectsdk.service.capability包,在下文中一共展示了PowerControl类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onReceiveCommand

import com.connectsdk.service.capability.PowerControl; //导入依赖的package包/类
@Override
public void onReceiveCommand(ConnectableDevice device, String channelId, LGWebOSHandler handler, Command command) {
    if (device == null) {
        /*
         * Unable to send anything to a null device. Unless the user configured autoupdate="false" neither
         * onDeviceReady nor onDeviceRemoved will be called and item state would be permanently inconsistent.
         * Therefore setting state to OFF
         */
        handler.postUpdate(channelId, OnOffType.OFF);
        return;
    }

    if (OnOffType.ON == command || OnOffType.OFF == command) {
        if (OnOffType.ON == command && device.hasCapabilities(PowerControl.On)) {
            getControl(device).powerOn(createDefaultResponseListener());
        } else if (OnOffType.OFF == command && device.hasCapabilities(PowerControl.Off)) {
            getControl(device).powerOff(createDefaultResponseListener());
        }
    } else {
        logger.warn("only accept OnOffType");
        return;
    }
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:24,代码来源:PowerControlPower.java


示例2: getPriorityLevel

import com.connectsdk.service.capability.PowerControl; //导入依赖的package包/类
@Override
public CapabilityPriorityLevel getPriorityLevel(Class<? extends CapabilityMethods> clazz) {
    if (clazz.equals(MediaPlayer.class)) {
        return getMediaPlayerCapabilityLevel();
    }
    else if (clazz.equals(MediaControl.class)) {
        return getMediaControlCapabilityLevel();
    }
    else if (clazz.equals(Launcher.class)) {
        return getLauncherCapabilityLevel();
    }
    else if (clazz.equals(TVControl.class)) {
        return getTVControlCapabilityLevel();
    }
    else if (clazz.equals(VolumeControl.class)) {
        return getVolumeControlCapabilityLevel();
    }
    else if (clazz.equals(ExternalInputControl.class)) {
        return getExternalInputControlPriorityLevel();
    }
    else if (clazz.equals(MouseControl.class)) {
        return getMouseControlCapabilityLevel();
    }
    else if (clazz.equals(TextInputControl.class)) {
        return getTextInputControlCapabilityLevel();
    }
    else if (clazz.equals(PowerControl.class)) {
        return getPowerControlCapabilityLevel();
    }
    else if (clazz.equals(KeyControl.class)) {
        return getKeyControlCapabilityLevel();
    }
    return CapabilityPriorityLevel.NOT_SUPPORTED;
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:35,代码来源:NetcastTVService.java


示例3: testGetPriorityLevel

import com.connectsdk.service.capability.PowerControl; //导入依赖的package包/类
@Test
public void testGetPriorityLevel() {
    Assert.assertEquals(CapabilityMethods.CapabilityPriorityLevel.HIGH,
            service.getPriorityLevel(MediaPlayer.class));
    Assert.assertEquals(CapabilityMethods.CapabilityPriorityLevel.NOT_SUPPORTED,
            service.getPriorityLevel(ExternalInputControl.class));
    Assert.assertEquals(CapabilityMethods.CapabilityPriorityLevel.NOT_SUPPORTED,
            service.getPriorityLevel(KeyControl.class));
    Assert.assertEquals(CapabilityMethods.CapabilityPriorityLevel.NOT_SUPPORTED,
            service.getPriorityLevel(Launcher.class));
    Assert.assertEquals(CapabilityMethods.CapabilityPriorityLevel.HIGH,
            service.getPriorityLevel(MediaControl.class));
    Assert.assertEquals(CapabilityMethods.CapabilityPriorityLevel.NOT_SUPPORTED,
            service.getPriorityLevel(MouseControl.class));
    Assert.assertEquals(CapabilityMethods.CapabilityPriorityLevel.NOT_SUPPORTED,
            service.getPriorityLevel(PlaylistControl.class));
    Assert.assertEquals(CapabilityMethods.CapabilityPriorityLevel.NOT_SUPPORTED,
            service.getPriorityLevel(PowerControl.class));
    Assert.assertEquals(CapabilityMethods.CapabilityPriorityLevel.NOT_SUPPORTED,
            service.getPriorityLevel(TextInputControl.class));
    Assert.assertEquals(CapabilityMethods.CapabilityPriorityLevel.NOT_SUPPORTED,
            service.getPriorityLevel(ToastControl.class));
    Assert.assertEquals(CapabilityMethods.CapabilityPriorityLevel.NOT_SUPPORTED,
            service.getPriorityLevel(TVControl.class));
    Assert.assertEquals(CapabilityMethods.CapabilityPriorityLevel.NOT_SUPPORTED,
            service.getPriorityLevel(VolumeControl.class));
    Assert.assertEquals(CapabilityMethods.CapabilityPriorityLevel.NOT_SUPPORTED,
            service.getPriorityLevel(WebAppLauncher.class));
    Assert.assertEquals(CapabilityMethods.CapabilityPriorityLevel.NOT_SUPPORTED,
            service.getPriorityLevel(null));
}
 
开发者ID:ConnectSDK,项目名称:Connect-SDK-Android-FireTV,代码行数:32,代码来源:FireTVServiceTest.java


示例4: setTv

import com.connectsdk.service.capability.PowerControl; //导入依赖的package包/类
public void setTv(ConnectableDevice tv)
{
    mTv = tv;

    if (tv == null) {
        launcher = null;
        mediaPlayer = null;
        mediaControl = null;
        tvControl = null;
        volumeControl = null;
        toastControl = null;
        textInputControl = null;
        mouseControl = null;
        externalInputControl = null;
        powerControl = null;
        keyControl = null;
        webAppLauncher = null;

        disableButtons();
    }
    else {
        launcher = mTv.getCapability(Launcher.class);
        mediaPlayer = mTv.getCapability(MediaPlayer.class);
        mediaControl = mTv.getCapability(MediaControl.class);
        tvControl = mTv.getCapability(TVControl.class);
        volumeControl = mTv.getCapability(VolumeControl.class);
        toastControl = mTv.getCapability(ToastControl.class);
        textInputControl = mTv.getCapability(TextInputControl.class);
        mouseControl = mTv.getCapability(MouseControl.class);
        externalInputControl = mTv.getCapability(ExternalInputControl.class);
        powerControl = mTv.getCapability(PowerControl.class);
        keyControl = mTv.getCapability(KeyControl.class);
        webAppLauncher = mTv.getCapability(WebAppLauncher.class);

        enableButtons();
    }
}
 
开发者ID:ConnectSDK,项目名称:Connect-SDK-Android-API-Sampler,代码行数:38,代码来源:BaseFragment.java


示例5: getPowerControl

import com.connectsdk.service.capability.PowerControl; //导入依赖的package包/类
/**************
POWER CONTROL
 **************/
@Override
public PowerControl getPowerControl() {
    return this;
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:8,代码来源:NetcastTVService.java


示例6: updateCapabilities

import com.connectsdk.service.capability.PowerControl; //导入依赖的package包/类
@Override
protected void updateCapabilities() {
    List<String> capabilities = new ArrayList<String>();

    if (DiscoveryManager.getInstance().getPairingLevel() == PairingLevel.ON) {
        Collections.addAll(capabilities, TextInputControl.Capabilities);
        Collections.addAll(capabilities, MouseControl.Capabilities);
        Collections.addAll(capabilities, KeyControl.Capabilities);
        Collections.addAll(capabilities, MediaPlayer.Capabilities);

        capabilities.add(PowerControl.Off);

        capabilities.add(Play); 
        capabilities.add(Pause); 
        capabilities.add(Stop); 
        capabilities.add(Duration); 
        capabilities.add(Position); 
        capabilities.add(Seek); 

        capabilities.add(Application); 
        capabilities.add(Application_Close); 
        capabilities.add(Application_List); 
        capabilities.add(Browser); 
        capabilities.add(Hulu); 
        capabilities.add(Netflix); 
        capabilities.add(Netflix_Params); 
        capabilities.add(YouTube); 
        capabilities.add(YouTube_Params); 
        capabilities.add(AppStore); 

        capabilities.add(Channel_Up); 
        capabilities.add(Channel_Down); 
        capabilities.add(Channel_Get); 
        capabilities.add(Channel_List); 
        capabilities.add(Channel_Subscribe); 
        capabilities.add(Get_3D); 
        capabilities.add(Set_3D); 
        capabilities.add(Subscribe_3D); 

        capabilities.add(Picker_Launch); 
        capabilities.add(Picker_Close); 

        capabilities.add(Volume_Get); 
        capabilities.add(Volume_Up_Down); 
        capabilities.add(Mute_Get); 
        capabilities.add(Mute_Set);

        if (serviceDescription.getModelNumber().equals("4.0")) {
            capabilities.add(AppStore_Params); 
        }
    } else {
        Collections.addAll(capabilities, MediaPlayer.Capabilities);
        capabilities.add(Play); 
        capabilities.add(Pause); 
        capabilities.add(Stop); 

        capabilities.add(YouTube); 
        capabilities.add(YouTube_Params); 
    }

    capabilities.add(MediaPlayer.Subtitle_SRT);
    setCapabilities(capabilities);
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:64,代码来源:NetcastTVService.java


示例7: getPriorityLevel

import com.connectsdk.service.capability.PowerControl; //导入依赖的package包/类
@Override
public CapabilityPriorityLevel getPriorityLevel(Class<? extends CapabilityMethods> clazz) {
    if (clazz.equals(MediaPlayer.class)) {
        return getMediaPlayerCapabilityLevel();
    }
    else if (clazz.equals(MediaControl.class)) {
        return getMediaControlCapabilityLevel();
    }
    else if (clazz.equals(Launcher.class)) {
        return getLauncherCapabilityLevel();
    }
    else if (clazz.equals(TVControl.class)) {
        return getTVControlCapabilityLevel();
    }
    else if (clazz.equals(VolumeControl.class)) {
        return getVolumeControlCapabilityLevel();
    }
    else if (clazz.equals(ExternalInputControl.class)) {
        return getExternalInputControlPriorityLevel();
    }
    else if (clazz.equals(MouseControl.class)) {
        return getMouseControlCapabilityLevel();
    }
    else if (clazz.equals(TextInputControl.class)) {
        return getTextInputControlCapabilityLevel();
    }
    else if (clazz.equals(PowerControl.class)) {
        return getPowerControlCapabilityLevel();
    }
    else if (clazz.equals(KeyControl.class)) {
        return getKeyControlCapabilityLevel();
    }
    else if (clazz.equals(ToastControl.class)) {
        return getToastControlCapabilityLevel();
    }
    else if (clazz.equals(WebAppLauncher.class)) {
        return getWebAppLauncherCapabilityLevel();
    }
    else if (clazz.equals(PlaylistControl.class)) {
        return getPlaylistControlCapabilityLevel();
    }
    return CapabilityPriorityLevel.NOT_SUPPORTED;
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:44,代码来源:WebOSTVService.java


示例8: updateCapabilities

import com.connectsdk.service.capability.PowerControl; //导入依赖的package包/类
@Override
protected void updateCapabilities() {
    List<String> capabilities = new ArrayList<String>();

    Collections.addAll(capabilities, VolumeControl.Capabilities);
    Collections.addAll(capabilities, MediaPlayer.Capabilities);

    if (DiscoveryManager.getInstance().getPairingLevel() == PairingLevel.ON) {
        Collections.addAll(capabilities, TextInputControl.Capabilities);
        Collections.addAll(capabilities, MouseControl.Capabilities);
        Collections.addAll(capabilities, KeyControl.Capabilities);
        Collections.addAll(capabilities, MediaPlayer.Capabilities);
        Collections.addAll(capabilities, Launcher.Capabilities);
        Collections.addAll(capabilities, TVControl.Capabilities);
        Collections.addAll(capabilities, ExternalInputControl.Capabilities);
        Collections.addAll(capabilities, ToastControl.Capabilities);
        capabilities.add(PowerControl.Off);
    } else {
        capabilities.add(Application);
        capabilities.add(Application_Params);
        capabilities.add(Application_Close);
        capabilities.add(Browser);
        capabilities.add(Browser_Params);
        capabilities.add(Hulu);
        capabilities.add(Netflix);
        capabilities.add(Netflix_Params);
        capabilities.add(YouTube);
        capabilities.add(YouTube_Params);
        capabilities.add(AppStore);
        capabilities.add(AppStore_Params);
        capabilities.add(AppState);
        capabilities.add(AppState_Subscribe);
    }

    if (serviceDescription != null) {
        if (serviceDescription.getVersion() != null
                && (serviceDescription.getVersion().contains("4.0.0")
                || serviceDescription.getVersion().contains("4.0.1"))) {
            capabilities.add(Launch);
            capabilities.add(Launch_Params);

            capabilities.add(Play);
            capabilities.add(Pause);
            capabilities.add(Stop);
            capabilities.add(Seek);
            capabilities.add(Position);
            capabilities.add(Duration);
            capabilities.add(PlayState);

            capabilities.add(WebAppLauncher.Close);

            if (getDLNAService() != null) {
                capabilities.add(MediaPlayer.Subtitle_SRT);
            }
        } else {
            Collections.addAll(capabilities, WebAppLauncher.Capabilities);
            Collections.addAll(capabilities, MediaControl.Capabilities);

            capabilities.add(MediaPlayer.Subtitle_WebVTT);

            capabilities.add(PlaylistControl.JumpToTrack);
            capabilities.add(PlaylistControl.Next);
            capabilities.add(PlaylistControl.Previous);

            capabilities.add(MediaPlayer.Loop);
        }

    }

    setCapabilities(capabilities);
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:72,代码来源:WebOSTVService.java


示例9: updateCapabilities

import com.connectsdk.service.capability.PowerControl; //导入依赖的package包/类
@Override
protected void updateCapabilities() {
    List<String> capabilities = new ArrayList<String>();

    if (DiscoveryManager.getInstance().getPairingLevel() == PairingLevel.ON) {
        Collections.addAll(capabilities, TextInputControl.Capabilities);
        Collections.addAll(capabilities, MouseControl.Capabilities);
        Collections.addAll(capabilities, KeyControl.Capabilities);
        Collections.addAll(capabilities, MediaPlayer.Capabilities);

        capabilities.add(PowerControl.Off);

        capabilities.add(Play); 
        capabilities.add(Pause); 
        capabilities.add(Stop); 
        capabilities.add(Rewind); 
        capabilities.add(FastForward); 
        capabilities.add(Duration); 
        capabilities.add(Position); 
        capabilities.add(Seek); 

        capabilities.add(Application); 
        capabilities.add(Application_Close); 
        capabilities.add(Application_List); 
        capabilities.add(Browser); 
        capabilities.add(Hulu); 
        capabilities.add(Netflix); 
        capabilities.add(Netflix_Params); 
        capabilities.add(YouTube); 
        capabilities.add(YouTube_Params); 
        capabilities.add(AppStore); 

        capabilities.add(Channel_Up); 
        capabilities.add(Channel_Down); 
        capabilities.add(Channel_Get); 
        capabilities.add(Channel_List); 
        capabilities.add(Channel_Subscribe); 
        capabilities.add(Get_3D); 
        capabilities.add(Set_3D); 
        capabilities.add(Subscribe_3D); 

        capabilities.add(Picker_Launch); 
        capabilities.add(Picker_Close); 

        capabilities.add(Volume_Get); 
        capabilities.add(Volume_Up_Down); 
        capabilities.add(Mute_Get); 
        capabilities.add(Mute_Set);

        if (serviceDescription.getModelNumber().equals("4.0")) {
            capabilities.add(AppStore_Params); 
        }
    } else {
        Collections.addAll(capabilities, MediaPlayer.Capabilities);
        capabilities.add(Play); 
        capabilities.add(Pause); 
        capabilities.add(Stop); 
        capabilities.add(Rewind); 
        capabilities.add(FastForward); 

        capabilities.add(YouTube); 
        capabilities.add(YouTube_Params); 
    }

    setCapabilities(capabilities);
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:67,代码来源:NetcastTVService.java


示例10: updateCapabilities

import com.connectsdk.service.capability.PowerControl; //导入依赖的package包/类
@Override
protected void updateCapabilities() {
    List<String> capabilities = new ArrayList<String>();

    if (DiscoveryManager.getInstance().getPairingLevel() == PairingLevel.ON) {
        Collections.addAll(capabilities, TextInputControl.Capabilities);
        Collections.addAll(capabilities, MouseControl.Capabilities);
        Collections.addAll(capabilities, KeyControl.Capabilities);
        Collections.addAll(capabilities, MediaPlayer.Capabilities);
        Collections.addAll(capabilities, Launcher.Capabilities);
        Collections.addAll(capabilities, TVControl.Capabilities);
        Collections.addAll(capabilities, ExternalInputControl.Capabilities);
        Collections.addAll(capabilities, VolumeControl.Capabilities);
        Collections.addAll(capabilities, ToastControl.Capabilities);

        capabilities.add(PowerControl.Off);
    } else {
        Collections.addAll(capabilities, VolumeControl.Capabilities);
        Collections.addAll(capabilities, MediaPlayer.Capabilities);

        capabilities.add(Application);
        capabilities.add(Application_Params);
        capabilities.add(Application_Close);
        capabilities.add(Browser);
        capabilities.add(Browser_Params);
        capabilities.add(Hulu);
        capabilities.add(Netflix);
        capabilities.add(Netflix_Params);
        capabilities.add(YouTube);
        capabilities.add(YouTube_Params);
        capabilities.add(AppStore);
        capabilities.add(AppStore_Params);
        capabilities.add(AppState);
        capabilities.add(AppState_Subscribe);
    }

    if (serviceDescription != null && serviceDescription.getVersion() != null) {
        if (serviceDescription.getVersion().contains("4.0.0") || serviceDescription.getVersion().contains("4.0.1")) {
            capabilities.add(Launch);
            capabilities.add(Launch_Params);

            capabilities.add(Play);
            capabilities.add(Pause);
            capabilities.add(Stop);
            capabilities.add(Seek);
            capabilities.add(Position);
            capabilities.add(Duration);
            capabilities.add(PlayState);

            capabilities.add(WebAppLauncher.Close);
        } else {
            Collections.addAll(capabilities, WebAppLauncher.Capabilities);
            Collections.addAll(capabilities, MediaControl.Capabilities);

            capabilities.add(PlaylistControl.JumpToTrack);
            capabilities.add(PlaylistControl.Next);
            capabilities.add(PlaylistControl.Previous);

            capabilities.add(MediaPlayer.Loop);
        }
    }

    setCapabilities(capabilities);
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:65,代码来源:WebOSTVService.java


示例11: getControl

import com.connectsdk.service.capability.PowerControl; //导入依赖的package包/类
private PowerControl getControl(ConnectableDevice device) {
    return device.getCapability(PowerControl.class);
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:4,代码来源:PowerControlPower.java


示例12: getPowerControl

import com.connectsdk.service.capability.PowerControl; //导入依赖的package包/类
public PowerControl getPowerControl() 
{
    return powerControl;
}
 
开发者ID:ConnectSDK,项目名称:Connect-SDK-Android-API-Sampler,代码行数:5,代码来源:BaseFragment.java


示例13: getPowerControl

import com.connectsdk.service.capability.PowerControl; //导入依赖的package包/类
/**
 * Accessor for highest priority PowerLauncher object
 * This method is deprecated. Use
 * `ConnectableDevice#getCapability(Class<T> controllerClass)` method instead
 */
@Deprecated
public PowerControl getPowerControl() {
    return getCapability(PowerControl.class);
}
 
开发者ID:david-fenton,项目名称:Connect-SDK-Cordova-Plugin,代码行数:10,代码来源:ConnectableDevice.java



注:本文中的com.connectsdk.service.capability.PowerControl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ProgressResponseBody类代码示例发布时间:2022-05-22
下一篇:
Java BaseProjectWizardFields类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap