parameters: (self)
return_statement: return True
docstring: Turn off media player.
docstring_summary: Turn off media player.
docstring_tokens: Turn off media player .
function: def _turn_off(self):
          """Turn off media player."""
          if self._power_off_in_progress():
              return False
  
          cmd_power_off = "KEY_POWER"
          cmd_power_art = "KEY_POWER"
          self._ws.set_power_off_request()
          if self._state == STATE_ON:
              if self._ws.artmode_status == ArtModeStatus.Unsupported:
                  self.send_command(cmd_power_off)
              else:
                  self.send_command(f"{cmd_power_art},3000")
          elif self._ws.artmode_status == ArtModeStatus.On:
              self.send_command(f"{cmd_power_art},3000")
          else:
              return False
  
          self._end_of_power_off = dt_util.utcnow() + timedelta(
              seconds=POWER_OFF_DELAY
          )
  
          return True
function_tokens: def _turn_off ( self ) : if self . _power_off_in_progress ( ) : return False cmd_power_off = "KEY_POWER" cmd_power_art = "KEY_POWER" self . _ws . set_power_off_request ( ) if self . _state == STATE_ON : if self . _ws . artmode_status == ArtModeStatus . Unsupported : self . send_command ( cmd_power_off ) else : self . send_command ( f"{cmd_power_art},3000" ) elif self . _ws . artmode_status == ArtModeStatus . On : self . send_command ( f"{cmd_power_art},3000" ) else : return False self . _end_of_power_off = dt_util . utcnow ( ) + timedelta ( seconds = POWER_OFF_DELAY ) return True