项目作者: flexnst

项目描述 :
LG WebOS TV control with Laravel
高级语言: PHP
项目地址: git://github.com/flexnst/laravel-lgtv.git
创建时间: 2019-09-24T15:54:41Z
项目社区:https://github.com/flexnst/laravel-lgtv

开源协议:

下载


Control LG WebOS TV with Laravel

The package allows you to control the status of LG Smart TVs based on WebOS, switch channels, control sound, launch applications and emulate pressing buttons on the remote control.

Installation

  1. composer require flexnst/laravel-lgtv
  1. php artisan vendor:publish --provider="Flexnst\LgTv\LgTvServiceProvider" --tag=config

Usage examples

Discover TV ip address on network:

  1. $ip = \LgTv::device()->discover();

Start TV:

  1. \LgTv::device()->turn_on();

TV off:

  1. \LgTv::device()->turn_off();

Show float message on TV screen:

  1. \LgTv::device()->show_float('Hello!');

Support many devices

  1. // config/lgtv.php
  2. <?php
  3. return [
  4. 'devices' => [
  5. 'tv1' => [
  6. 'ip' => env('LGTV_TV1_IP'),
  7. 'mac' => env('LGTV_TV1_MAC'),
  8. 'key_path' => storage_path('lgtv_tv1.key')
  9. ]
  10. ],
  11. 'default' => 'tv1'
  12. ];

Available methods

  • discover(bool $as_array = false)
  • is_on()
  • turn_on()
  • turn_off()
  • show_float(string $message)
  • open_browser_at(string $url)
  • get_mute()
  • set_mute(bool $status)
  • toggle_mute()
  • channels($hidden = false)
  • get_channel()
  • set_channel(string $channelId)
  • get_volume()
  • set_volume(int $volumelevel)
  • input_play()
  • input_pause()
  • input_stop()
  • input_forward()
  • input_rewind()
  • input_enter()
  • input_channel_up()
  • input_channel_down()
  • input_volume_up()
  • input_volume_down()
  • input_backspace(int $countCharacters)
  • input_three_d_on()
  • input_three_d_off()
  • get_audio_status()
  • get_sw_info()
  • get_services()
  • get_apps()
  • open_app_with_payload(array $payload)
  • start_app(string $appid)
  • close_app(string $appid)
  • open_youtube_by_url(string $url)
  • open_youtube_by_id(string $id)
  • button(string $button)