def action_volume_mute(self, cecdev=None): ''' Sound volume down on CEC service @param adapter int CEC service ID ''' if not cecdev: cecdev = self.cur_service dev = cec.Service(cecdev) if dev.is_on: dev.volume_down()
def action_volume_mute(self, cecdev=None): ''' Mute CEC service @param adapter int CEC service ID ''' if not cecdev: cecdev = self.cur_service dev = cec.Service(cecdev) if dev.is_on: dev.mute()
def action_power_off(self, cecdev=None): ''' Turn CEC service power off @param adapter int CEC service ID ''' if not cecdev: cecdev = self.cur_service dev = cec.Service(cecdev) if dev.is_on: dev.power_off()
def action_set_service(self, service): ''' Set default CEC service @param adapter int Default service ID ''' self.cur_service = cec.Service(service) self.action_describe_service(service) meta = {'device': self.adapter} if self.location: meta.update({'location': self.location}) self.sendEvent('set_service', {'active_service': { 'value': self.cur_service }}, meta)
def action_power_toggle(self, cecdev=None): ''' Toggle CEC service power @param adapter int CEC service ID ''' if not cecdev: cecdev = self.cur_service dev = cec.Service(cecdev) if dev.is_on: dev.power_off() elif not dev.is_on: dev.power_on() else: log.warn( 'powertoggle failed because power status could not be determined' )
def action_describe_service(self, cecdev): ''' Describe a connected CEC service ''' dev = cec.Service(cecdev) meta = {'device': cecdev} if self.location: meta.update({'location': self.location}) self.sendEvent( 'service_describe', { 'address': dev.address, 'phy': dev.physical_address, 'vendor': dev.vendor, 'OSD': dev.osd_string, 'cec_version': dev.cec_version, 'language': dev.language }, meta)