raman325 / pyvizio

Python client for Vizio SmartCast
MIT License
110 stars 29 forks source link

Add Vizio Crave360 portable speaker #119

Closed jezzab closed 3 years ago

jezzab commented 3 years ago

Can be accessed with: python3 cli.py --ip=<ip> --device_type=crave360 get-charging-status or python3 cli.py --ip=<ip> --device_type=crave360 get-battery-level

Crave360 does not require any auth at all. Left existing code as it does not effect the operation

raman325 commented 3 years ago

Thanks for submitting this, looks good and agreed that it doesn't change any existing functionality. Can you just confirm one more time that everything is working as you expect on this PR? I'm happy to merge it, but I don't have the device so I am flying blind in terms of review 🙂

jezzab commented 3 years ago

Totally understand, I've just tested it one more time. Here is some of the output:

$ python3 cli.py --ip=0 discover
INFO:pyvizio:[ZeroconfDevice({'name': 'Outside Speaker', 'ip': '10.0.0.154', 'port': 9000, 'model': 'SP50-D5', 'id': 'my-id-is-in-here'})]
INFO:__main__:
IP            Port  Model    Name
----------  ------  -------  ---------------
10.0.0.154    9000  SP50-D5  Outside Speaker
$ python3 cli.py --ip=10.0.0.154 --device_type=crave360 get-all-audio-settings
INFO:__main__:
Name       Value
---------  --------
bass       0
treble     0
eq         Enhanced
truvolume  Off
volume     17
mute       Off

$ python3 cli.py --ip=10.0.0.154 --device_type=crave360 volume
INFO:__main__:Increasing volume
INFO:__main__:OK

$ python3 cli.py --ip=10.0.0.154 --device_type=crave360 volume
INFO:__main__:Increasing volume
INFO:__main__:OK

$ python3 cli.py --ip=10.0.0.154 --device_type=crave360 volume
INFO:__main__:Increasing volume
INFO:__main__:OK

$ python3 cli.py --ip=10.0.0.154 --device_type=crave360 mute
INFO:__main__:Toggling mute
INFO:__main__:OK

$ python3 cli.py --ip=10.0.0.154 --device_type=crave360 get-all-audio-settings
INFO:__main__:
Name       Value
---------  --------
bass       0
treble     0
eq         Enhanced
truvolume  Off
volume     20
mute       On

Inputs:

$ python3 cli.py --ip=10.0.0.154 --device_type=crave360 get-inputs-list
INFO:__main__:
Name       Nickname
---------  ----------
Bluetooth  bluetooth
USB        usb

Pulled off the base:

$ python3 cli.py --ip=10.0.0.154 --device_type=crave360 get-battery-level
INFO:__main__:Current battery level: 100

$ python3 cli.py --ip=10.0.0.154 --device_type=crave360 get-charging-status
INFO:__main__:Device is not charging

Back on the base:

$ python3 cli.py --ip=10.0.0.154 --device_type=crave360 get-charging-status
INFO:__main__:Device is charging

$ python3 cli.py --ip=10.0.0.154 --device_type=crave360 get-battery-level
INFO:__main__:Current battery level: Charging

Powering off:

$ python3 cli.py --ip=10.0.0.154 --device_type=crave360 power
INFO:__main__:Toggling Power
INFO:__main__:OK
raman325 commented 3 years ago

Looks great! Thanks for responding. I will push a new version of pyvizio (0.1.59) shortly