from .switchbot_ir_device import SwitchbotIrDevice
[docs]class IrTv(SwitchbotIrDevice):
"""Switchbot virtual ir Tv"""
def __init__(self, deviceId):
super().__init__(deviceId)
[docs] def set_channel(self, channel: int) -> str:
"""Next channel"""
self._body["command"] = "SetChannel"
parameter = f"{channel}"
self._body["parameter"] = parameter
result = self.command(self.deviceId, self._body)
return result.text
[docs] def volume_add(self) -> str:
"""Volume up"""
self._body["command"] = "volumeAdd"
result = self.command(self.deviceId, self._body)
return result.text
[docs] def volume_sub(self) -> str:
"""Volume down"""
self._body["command"] = "volumeSub"
result = self.command(self.deviceId, self._body)
return result.text
[docs] def channel_add(self) -> str:
"""Next channel"""
self._body["command"] = "channelAdd"
result = self.command(self.deviceId, self._body)
return result.text
[docs] def channel_sub(self) -> str:
"""Previous channel"""
self._body["command"] = "channelSub"
result = self.command(self.deviceId, self._body)
return result.text
[docs]class IrStreamer(IrTv):
"""Streamer class"""
def __init__(self, deviceId):
super().__init__(deviceId)
[docs]class IrSetTopBox(IrTv):
"""Set Top Box class"""
def __init__(self, deviceId):
super().__init__(deviceId)