Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge fork into main branch #3

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0ae69c6
Zone and system call implementation
grandDam Aug 17, 2017
a68493b
Zone and system call implementation
grandDam Aug 17, 2017
a719d2e
Netusb call implementation
grandDam Aug 27, 2017
c15e631
Api, Services and Tests
grandDam Oct 13, 2017
7256f6b
Api, Services and Tests
grandDam Oct 13, 2017
e1829ff
Merge pull request #1 from grandDam/callImpl
grandDam Oct 13, 2017
f9f74a4
Fix missing local test file
grandDam Oct 13, 2017
0ada1e2
Merge pull request #2 from grandDam/callImpl
grandDam Oct 13, 2017
59e3d98
Make lint.sh executable
grandDam Oct 13, 2017
64c79db
Fix 5.6 compatibility
grandDam Oct 14, 2017
33a5986
Make lint.sh executable
grandDam Oct 14, 2017
f3427ff
Fix 5.6 compatibility
grandDam Oct 14, 2017
80a1843
Fix force lowest issue
grandDam Oct 14, 2017
41190fc
Fix 5.6 compatibility
grandDam Oct 14, 2017
b2a7226
Fix force lowest issue
grandDam Oct 14, 2017
11f4c87
Fix force lowest issue
grandDam Oct 14, 2017
f655716
Fix force lowest issue in php 7.2
grandDam Oct 14, 2017
2fcb45e
Add/Remove speaker feature
grandDam Oct 15, 2017
764cbc3
Merge pull request #3 from grandDam/callImpl
grandDam Oct 16, 2017
7d14bac
API Call refacto + more tests
grandDam Oct 21, 2017
3aa7053
Fix 5.6 compatibility
grandDam Oct 21, 2017
c47220e
Fix 5.6 compatibility
grandDam Oct 21, 2017
7d7e184
Merge pull request #4 from grandDam/callImpl
grandDam Oct 21, 2017
b55a289
Move methods from controller to speaker
grandDam Oct 31, 2017
86c24d8
Merge pull request #5 from grandDam/master
grandDam Oct 31, 2017
932692b
Merge pull request #6 from grandDam/callImpl
grandDam Oct 31, 2017
c5d67ee
PLaylist and favorites managed by speaker
grandDam Nov 1, 2017
32b2515
Merge remote-tracking branch 'origin/callImpl' into callImpl
grandDam Nov 1, 2017
08dbaf3
Merge pull request #7 from grandDam/callImpl
grandDam Nov 1, 2017
6606b27
Remove cached speakers to handle multi app modification
grandDam Nov 3, 2017
04c8150
Fix muting/unmuting
grandDam Nov 4, 2017
f1aff79
Update README.md
felixbublitz Jan 31, 2019
570c41d
name in error
lucguinchard Feb 11, 2019
a42da0f
Merge pull request #8 from felixbublitz/patch-1
grandDam Mar 31, 2019
b638fd1
Merge pull request #9 from lucguinchard/patch-2
grandDam Sep 23, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
service_name: travis-ci
coverage_clover: clover.xml
json_path: coveralls.json
Empty file modified .editorconfig
100644 → 100755
Empty file.
3 changes: 2 additions & 1 deletion .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Created by .ignore support plugin (hsz.mobi)
/vendor/
/test/env.yml
/tests/env.yml
/phpunit.xml
/composer.lock
/.php_cs.cache
/.idea/
Empty file modified .styleci.yml
100644 → 100755
Empty file.
26 changes: 22 additions & 4 deletions .travis.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,30 @@ php:
- 5.6
- 7.0
- 7.1
- 7.2
- nightly

sudo: false
matrix:
allow_failures:
- php: nightly

env:
- COMPOSER_OPTS=""
- COMPOSER_OPTS="--prefer-lowest"

install:
- travis_retry composer install --no-interaction --prefer-source
- composer self-update --snapshot
- composer update $COMPOSER_OPTS

script:
- cp test/env.yml.dist test/env.yml
- vendor/bin/phpunit --verbose --coverage-text
- vendor/bin/phpunit --coverage-clover=clover.xml
- tests/lint.sh

after_success:
- vendor/bin/coveralls

git:
depth: 5

dist: trusty
sudo: false
5 changes: 5 additions & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This api is highly inspired by the excellent Github project

[KnpLabs/php-github-api](https://github.com/KnpLabs/php-github-api)

[duncan3dc/sonos](https://github.com/duncan3dc/sonos)
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2013 Thomas Park

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
37 changes: 14 additions & 23 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Yamaha MusicCast API PHP Library

A simple wrapper for the Yamaha MusicCast API.
Not all call's have been implemented yet so pull requests are welcome!
A php library for interacting with Yamaha MusicCast speakers.

[![Build Status](https://travis-ci.org/samvdb/php-musiccast-api.svg?branch=master)](https://travis-ci.org/samvdb/php-musiccast-api)
[![Build Status](https://travis-ci.org/grandDam/php-musiccast-api.svg?branch=master)](https://travis-ci.org/grandDam/php-musiccast-api)

Based on the API specification found at [https://jayvee.com.au/downloads/commands/yamaha/YXC_API_Spec_Basic.pdf](https://jayvee.com.au/downloads/commands/yamaha/YXC_API_Spec_Basic.pdf)

Expand All @@ -25,27 +24,24 @@ $ curl -s http://getcomposer.org/installer | php

Via composer
```bash
$ composer require samvdb/php-musiccast-api php-http/guzzle6-adapter
$ composer require granddam/php-musiccast-api php-http/guzzle6-adapter
```

You can install any adapter you want but guzzle is probably fine for what you want to do.

## Creating a client
## Examples
Start all groups playing music

```php
$yamaha = new MusicCast\Client([
'host' => 'localhost',
'port' => 80, // default value
]);
```

## Using the API


```php
$result = $yamaha->api('zone')->status('main');
print_r($result);

require 'vendor/autoload.php';

$musicCast = new MusicCast\Network();
$controllers = $musicCast->getControllers();
foreach ($controllers as $controller) {
echo $controller->getGroup() + "\n";
echo "\tState: " . $controller->getStateName() . "\n";
$controller->play();
}
```

## Enabling events
Expand Down Expand Up @@ -89,11 +85,6 @@ while(true) {
$ composer test
```

## Credits

This api is highly inspired by the excellent Github api client made by KnpLabs!

[KnpLabs/php-github-api](https://github.com/KnpLabs/php-github-api)



Expand Down
103 changes: 61 additions & 42 deletions composer.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,46 +1,65 @@
{
"name": "samvdb/php-musiccast-api",
"description": "PHP Wrapper for Yamaha MusicCast API",
"type": "library",
"keywords": ["yamaha", "musiccast", "api"],
"license": "MIT",
"authors": [
{
"name": "Sam Van der Borght",
"email": "[email protected]"
}
],
"require": {
"php": "^5.5 || ^7.0",
"psr/http-message": "^1.0",
"psr/cache": "^1.0",
"php-http/httplug": "^1.1",
"php-http/discovery": "^1.0",
"php-http/client-implementation": "^1.0",
"php-http/client-common": "^1.3",
"php-http/cache-plugin": "^1.2",
"symfony/yaml": "^3.2",
"myclabs/php-enum": "^1.5"
"name": "granddam/php-musiccast-api",
"description": "A PHP library for interacting with Yamaha MusicCast speakers",
"type": "library",
"keywords": [
"yamaha",
"musiccast",
"api",
"client"
],
"license": "MIT",
"authors": [
{
"name": "Sam Van der Borght",
"email": "[email protected]"
},
"require-dev": {
"squizlabs/php_codesniffer": "^2.7",
"phpunit/phpunit": "^4.0 || ^5.5",
"phpunit/php-code-coverage": "^4",
"php-http/guzzle6-adapter": "^1.0",
"guzzlehttp/psr7": "^1.2",
"phpro/grumphp": "^0.11.1",
"nikic/php-parser": "^3.0",
"friendsofphp/php-cs-fixer": "^2.0"
},
"autoload": {
"psr-4": { "MusicCast\\": "lib/MusicCast/" }
},
"scripts": {
"test": "vendor/bin/phpunit"
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
{
"name": "Damien SUROT",
"email": "[email protected]"
}
],
"require": {
"php": "^5.6 || ^7.0",
"psr/http-message": "^1.0",
"psr/cache": "^1.0",
"php-http/httplug": "^1.1",
"php-http/discovery": "^1.0",
"php-http/client-implementation": "^1.0",
"php-http/client-common": "^1.3",
"php-http/cache-plugin": "^1.2",
"symfony/yaml": "^3.2",
"myclabs/php-enum": "^1.5",
"cache/doctrine-adapter": "^1.0",
"doctrine/cache": "^1.4"
},
"require-dev": {
"squizlabs/php_codesniffer": "^2.7",
"mockery/mockery": "^0.9.4",
"phpunit/phpunit": "^5.7.14",
"phpunit/php-code-coverage": "^4",
"php-http/guzzle6-adapter": "^1.0",
"guzzlehttp/psr7": "^1.2",
"phpro/grumphp": "^0.11.1",
"nikic/php-parser": "^3.0",
"friendsofphp/php-cs-fixer": "^2.0",
"satooshi/php-coveralls": "^1.0"
},
"autoload": {
"psr-4": {
"MusicCast\\": "src/",
"MusicCastTests\\": "tests/"
}
},
"scripts": {
"test": "vendor/bin/phpunit"
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"conflict": {
"php-http/message-factory": "< 1.0.2"
}
}
3 changes: 1 addition & 2 deletions grumphp.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ parameters:
standard: PSR2
ignore_patterns:
- "spec/*Spec.php"
- "test/*.php"
- "tests/*.php"
metadata:
priority: 300
phpcsfixer: ~
phpcsfixer2: ~
phpparser:
visitors:
no_exit_statements: ~
never_use_else: ~
forbidden_function_calls:
blacklist: [var_dump]
phpunit:
Expand Down
11 changes: 0 additions & 11 deletions lib/MusicCast/Api/Network.php

This file was deleted.

60 changes: 0 additions & 60 deletions lib/MusicCast/Api/System.php

This file was deleted.

11 changes: 0 additions & 11 deletions lib/MusicCast/Api/Usb.php

This file was deleted.

25 changes: 0 additions & 25 deletions lib/MusicCast/Api/Zone.php

This file was deleted.

Loading