Commit Graph

143 Commits (fe07d79744a269674726173fee1b57ad168ab26b)

Author SHA1 Message Date
Raman Gupta 671e324f48
update strings.json to match device name in manifest (#34003) 2020-04-11 10:42:56 +02:00
Raman Gupta c3542f8bb2
Vizio dependency version bump (#34002) 2020-04-11 10:31:44 +02:00
Raman Gupta 127cc744a4
Bump pyvizio version for vizio (#33924) 2020-04-09 16:09:05 -07:00
Raman Gupta b46eee04e4
Fix vizio bug that occurs when CONF_APPS isn't in config entry… (#33857)
* fix bug when search for string in dict fails when dict is null

* another bug fix that I only noticed because of this other bug

* add test to cover failure scenario

* update docstring

* add additional assertions to cover failure scenario that's being fixed
2020-04-08 20:44:33 -07:00
HomeAssistant Azure ad619817c6 [ci skip] Translation update 2020-04-08 00:08:19 +00:00
HomeAssistant Azure f7b822d000 [ci skip] Translation update 2020-04-06 00:02:13 +00:00
Franck Nijhof 39336d3ea3
Add prettier (in pre-commit and CI) (#33693)
* Add prettier (in pre-commit and CI)

* Make all file prettier

* Change order

* Add to Azure Pipelines

* Fix a YAML file prettier caught as invalid

* Remove flow mapping using curly braces from all YAML service files
2020-04-05 17:27:16 +02:00
HomeAssistant Azure 8a8ee95336 [ci skip] Translation update 2020-04-04 00:07:23 +00:00
Paulus Schoutsen f1d3c0d19b
Remove unused manifest fields (#33595) 2020-04-03 12:58:19 -07:00
Raman Gupta 081b822d25
Add support for Vizio sound mode (#33200)
* add sound mode support for devices that support it

* make setting and unsetting flag better

* move eq and audio settings into constants

* fix missed statement to use constant instead of hardcoded string

* further fixes based on review

* bump pyvizio version to include newly identified app
2020-04-02 22:48:19 -04:00
Paulus Schoutsen c63ec698a1 Update translations 2020-04-01 11:43:30 -07:00
HomeAssistant Azure 2cfa0af532 [ci skip] Translation update 2020-04-01 00:05:04 +00:00
Raman Gupta 5047635224
update VIZIO name to match brand guidelines (#33465) 2020-03-31 22:28:08 +02:00
HomeAssistant Azure 3e0eaa3c87 [ci skip] Translation update 2020-03-31 00:02:51 +00:00
HomeAssistant Azure 5bedc4ede2 [ci skip] Translation update 2020-03-29 00:04:45 +00:00
HomeAssistant Azure 5f72ad8da6 [ci skip] Translation update 2020-03-28 00:08:09 +00:00
HomeAssistant Azure 6c4b4ad1e0 [ci skip] Translation update 2020-03-26 00:47:06 +00:00
Raman Gupta d5f4dfdd6b
Update vizio app_id state attribute to show app config dict in… (#32727)
* bump pyvizio and update app_id to show app config to aid in HA config generation. squashed from multiple commits to make a rebase on dev easier

* bump pyvizio for bug fixes

* fix pyvizio version number

* only return app_id if app is unknown and explicitly create the dict that's returned

* fix tests

* fix docstring for app_id
2020-03-25 09:35:36 -07:00
HomeAssistant Azure 763ed0dc7b [ci skip] Translation update 2020-03-24 13:18:47 +00:00
Raman Gupta ca3a22b5a3
Filter out duplicate app names from vizio's source list (#33051)
* filter out additional app config names from pyvizios app list

* add test

* change where filtering app list occurs

* fix test

* fix mistake in change

* hopefully final test fix

* fix test scenario that unknowingly broke with test change
2020-03-22 17:34:00 +01:00
Ville Skyttä 05abf37046
Type hint improvements (#32905)
* Complete helpers.entity_component type hints

* Add discovery info type
2020-03-18 19:27:25 +02:00
Raman Gupta 26d7b2164e
Move apps configuration to options flow for vizio integration (#32543)
* move apps configuration to options flow

* add additional assertion to new test

* add additional assertions for options update

* update docstrings, config validation, and tests based on review
2020-03-13 12:16:24 +01:00
Raman Gupta 6e97975ff8
Set self._current_app to None when vizio device is off (#32725) 2020-03-12 15:04:34 +01:00
Raman Gupta 77ebda0c20
Update Vizio `source` property to only return current app if i… (#32713)
* only return current app for source if current app is set

* check for None specifically

* make sure current app isn't called for speaker
2020-03-12 11:01:05 +01:00
Raman Gupta 28a5fca7f4
fix step name in strings.json for vizio (#32536) 2020-03-06 10:56:15 -08:00
Paulus Schoutsen a579fcf248
Add app support for TVs to Vizio integration (#32432)
* add app support

* code cleanup, add additional test, add CONF_APPS storage logic for import

* simplify schema defaults logic

* remove unnecessary lower() and fix docstring

* remove default return for popping CONF_APPS during import update because we know entry data has CONF_APPS due to if statement

* further simplification

* even more simplification

* fix type hints

* move app configuration to separate step, fix tests, and only make app updates if device_type == tv

* remove errors variable from tv_apps and move tv_apps schema out of ConfigFlow for consistency

* slight refactor

* remove unused error from strings.json

* set unique id as early as possible

* correct which dictionary to use to set unique id in pair_tv step
2020-03-05 13:34:12 -08:00
HomeAssistant Azure 104350265d [ci skip] Translation update 2020-03-04 18:13:24 +00:00
Raman Gupta 4f619691df
Add is_volume_muted property to vizio integration (#32332)
* add is_muted property and update tests

* black

* manually set is_muted on async_mute_volume calls to set state early

* combine two lines into one

* set is_muted to None when device is not on
2020-03-04 10:04:52 +01:00
HomeAssistant Azure da959c8f7b [ci skip] Translation update 2020-03-02 00:31:47 +00:00
HomeAssistant Azure 2d4ee01c1a [ci skip] Translation update 2020-02-29 00:31:43 +00:00
Raman Gupta b9fa32444a
Support vizio pairing through config flow (#31520)
* support pairing through config flow

* simplify import failure log messages

* remove unnecessary list comprehension

* bump pyvizio to add passing ClientSession in where it was missed

* show different message if user completes pairing through import

* remove dupe failure message since reasons for failure are the same in both instances

* remove extra constant

* add host reachability check during pairing workflow

* revert redundant connection check since check is implicitly done during pairing process

* fix rebase errors

* fix string

* updates based on review

* update docstring

* missed commit

* update import confirmation message to be less wordy

* use ConfigFlow _abort_if_unique_id_configured

* fix test
2020-02-27 22:04:59 -08:00
Raman Gupta 4236d62b44
Improve Vizio fix to avoid KeyError (#32163)
* dont set default volume_step on import check

* ensure config entry data['volume_step'] is set

* consolidate entry update during entry setup
2020-02-24 19:35:28 -08:00
HomeAssistant Azure a9e061270b [ci skip] Translation update 2020-02-25 00:32:13 +00:00
Raman Gupta 309989be89
Fix vizio bug to use 'get' to get volume_step since it is optional (#32151)
* use get to get volume_step since it is optional

* always set volume_step to default in options and data if its not included
2020-02-24 23:37:54 +01:00
HomeAssistant Azure 8257165562 [ci skip] Translation update 2020-02-23 00:31:50 +00:00
HomeAssistant Azure dc15b9c28e [ci skip] Translation update 2020-02-22 00:31:49 +00:00
HomeAssistant Azure a12c4da0ca [ci skip] Translation update 2020-02-21 00:33:51 +00:00
Raman Gupta 7a6b13cb0d
Update vizio dependency and integration name (#31975)
* bump pyvizio version and clean up code

* fix requirements

* update parameter to optional per review in docs PR
2020-02-20 08:43:29 -08:00
HomeAssistant Azure 4b3f9ecc2d [ci skip] Translation update 2020-02-19 00:31:49 +00:00
HomeAssistant Azure 2e5161997f [ci skip] Translation update 2020-02-18 00:31:41 +00:00
HomeAssistant Azure 84e4ef510e [ci skip] Translation update 2020-02-17 00:31:56 +00:00
HomeAssistant Azure 32bc94bdd6 [ci skip] Translation update 2020-02-14 00:31:49 +00:00
Franck Nijhof 0173c61fee
Spelling: Config(uration) (#31782) 2020-02-13 08:27:00 -08:00
HomeAssistant Azure 40e866a5bb [ci skip] Translation update 2020-02-13 00:31:46 +00:00
HomeAssistant Azure 9e233070a0 [ci skip] Translation update 2020-02-12 00:31:49 +00:00
Raman Gupta 284fd46ea8
For vizio integration, set unique ID early to prevent multiple zeroconf discovery items for the same device to appear (#31686)
* set unique ID early to prevent multiple zeroconf discovery items for the same device to appear

* add test
2020-02-10 14:54:52 -08:00
HomeAssistant Azure 5483de7e25 [ci skip] Translation update 2020-02-08 00:31:45 +00:00
HomeAssistant Azure 274cf23269 [ci skip] Translation update 2020-02-07 00:31:50 +00:00
HomeAssistant Azure 6f99bac557 [ci skip] Translation update 2020-02-06 00:31:53 +00:00
HomeAssistant Azure 3801d5adf4 [ci skip] Translation update 2020-02-05 00:31:54 +00:00
Raman Gupta 1efea50654
Update vizio host check to handle entries that don't have port (#31463)
* Update vizio host check to handle entries that don't have port

* add comment explaining no_port test for future

* remove _name_is_same function and support user updating name in config

* Update strings.json

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-02-04 11:31:03 -08:00
Raman Gupta 151f60658c
Bump pyvizio version for bug fixes (#31453) 2020-02-04 09:19:14 +01:00
Raman Gupta ee927fbc9e
Bump pyvizio version and add additional device info (#31417)
* bump pyvizio version and add additional device info

* add patches for get_model and get_version

* change keywrod argument to positional for _test_service
2020-02-03 08:41:58 +01:00
HomeAssistant Azure 787faaa508 [ci skip] Translation update 2020-02-03 00:31:45 +00:00
HomeAssistant Azure a958418ef1 [ci skip] Translation update 2020-02-02 00:31:45 +00:00
Raman Gupta a0067a298a
Remove Throttle on async_setup and bump pyvizio version (#31337) 2020-01-31 12:45:23 +01:00
HomeAssistant Azure 74413e07d0 [ci skip] Translation update 2020-01-31 00:31:57 +00:00
Raman Gupta 73ea34e417
Update media_player and add tests to qualify vizio integration for platinum quality score (#31187)
* add media player test and update media player logic to qualify vizio for platinum quality score

* add SCAN_INTERVAL and log message once when device goes from available to unavailable and vice versa

* move test constants into one file to avoid defining dupes in each test file

* move constant to shrink diff

* move pytest fixtures to conftest.py

* remove commented out code

* move unload test to test_init

* updates to tests and logging based on review

* bypass notification service

* add fixture so component setup makes it through config flow

* split failure tests into two

* fix setup and entity check for test_init and setup failures in test_media_player

* make domain references consistent across test files

* remove logging steps that were introduced to help debug

* move common patches out to new fixture and use config entry everywhere appropriate

* fix docstring

* add test for update options to increase code coverage

* add one more assert

* refactor test_media_player to move boiler plate logic out of each test into _test_init function

* final refactor of test_media_player to move repeat logic into separate function

* update docstrings

* refactor setup failure tests to move shared logic into private function

* fix last new functions code to use variable instead of static config variable

* remove trailing comma

* test that volume_step gets properly passed to Vizio volume function

* fix comment language

* assert with unittest.mock.call in _test_service and use config_entries.async_setup instead of config_entries.async_add

* replace config_entries.async_add with config_entries.async_setup everywhere

* simplify if statement for argument assertion

* fix logging based on style guide

* remove accidentally committed changes

* update scan interval to something more reasonable and add tests for availability changes

* change filter function to list comprehension, simplify log messages, remove default entity id from logs since it is user configurable, fix docstrings
2020-01-30 22:13:45 +01:00
HomeAssistant Azure 2c02334c1f [ci skip] Translation update 2020-01-29 00:31:54 +00:00
HomeAssistant Azure 6daec557b4 [ci skip] Translation update 2020-01-28 00:31:59 +00:00
HomeAssistant Azure d3511a3496 [ci skip] Translation update 2020-01-26 00:33:06 +00:00
Raman Gupta 1de003487e Fix connection failure log message in async_setup_entry for Vizio component (#31097)
* remove connection check during setup since it is already done during config flow

* revert change and fix log message

* demote connection setup to warning
2020-01-24 07:39:28 +01:00
HomeAssistant Azure 6da2904e12 [ci skip] Translation update 2020-01-24 00:31:41 +00:00
Raman Gupta 192b656635 Code Cleanup for Vizio component (#31076)
* code cleanup

* dont use named arguments for positional arguments

* remove extra comma
2020-01-23 01:55:34 +01:00
HomeAssistant Azure a0d2a3c6c5 [ci skip] Translation update 2020-01-23 00:31:52 +00:00
Raman Gupta 463d949ee0 Add zeroconf discovery support for vizio integration (#30949)
* add missing tests

* readd removed test

* add zeroconf discovery support for vizio integration

* no mock_coro_func needed

* add reasonable timeout and don't log exceptions from pyvizio due to timeout

* add test to test options update and bump pyvizio to avoid timeout issues

* update requirements_*

* fix gaps in coverage

* change return hint for async_setup_entry

* use source variables instead of strings

* only get unique ID if about to create entry

* update based on review

* Revert "update based on review"

This reverts commit 0d612a90eb7d02c92061f902973e527267e3110a.

* f-string

* fix last review

* revert cleanup changes to simplify PR

* remove unnecessary ConfigFlow object variables to simplify logic

* revert cleanup changes to make review easier, noted for future cleanup

* revert cleanup changes to make review easier, noted for future cleanup

* move zeroconf service type constant to test module
2020-01-22 10:13:35 +01:00
HomeAssistant Azure 7e604bed7d [ci skip] Translation update 2020-01-22 00:31:43 +00:00
HomeAssistant Azure 692e4f27c4 [ci skip] Translation update 2020-01-21 00:33:20 +00:00
Raman Gupta e535133016 Fix options update during import config flow step for vizio component (Bugfix for #30653) (#30977)
* fix options update logic during import

* add missing tests

* fix abort reasons and strings, add missing test

* combine steps when testing esn already exists

* readd removed test

* no mock_coro_func needed

* add block_until_done and assert entry options
2020-01-19 20:13:15 -08:00
HomeAssistant Azure f20b3515f2 [ci skip] Translation update 2020-01-20 00:31:55 +00:00
HomeAssistant Azure 6c84c126ea [ci skip] Translation update 2020-01-19 00:32:00 +00:00
Raman Gupta 8630a076a7 Use default media player device classes for vizio component (#30802)
* use media player defined device classes instead of custom ones, add options flow test, add timeout options parameter

* make options update error more generic

* fix config flow options update logic

* simplify logic for options update during import

* use platform list for load and unload

* update private config flow function name and description

* fix grammar in strings.json

* update mock config variable names to be more accurate

* remove timeout conf option, create device_class property

* update requirements

* update .coveragerc to indicate that config_flow has tests

* fix source of device_class property and move constants to const.py

* fix grammar in error message

* remove redundant device check in async_setup_entry since device connection is checked during config flow

* revert change to async_setup_entry, raise ConfigEntryNotReady if device can't be connected to

* update error text

* add more context to error text
2020-01-18 09:15:05 +01:00
HomeAssistant Azure 4d7c8e254b [ci skip] Translation update 2020-01-18 00:31:52 +00:00
Raman Gupta d63ea198f2 Bump pyvizio version to 0.1.1 (#30867)
* bump pyvizio version to resolve setup issue

* update requirements*.txt
2020-01-17 08:48:59 +01:00
HomeAssistant Azure 24a381456a [ci skip] Translation update 2020-01-17 00:31:45 +00:00
HomeAssistant Azure 01520a32d3 [ci skip] Translation update 2020-01-16 00:31:45 +00:00
Raman Gupta ac771addc1 Add Config Flow support, Device Registry support, available property to vizio component (#30653)
* add config flow support, device registry support, available property

* raise PlatformNotReady if HA cant connect to device

* remove test logging statement and fix integration title

* store import and last user input values so user can see errors next to value that caused error

* add PARALLEL_UPDATES

* add missing type hints

* add missing type hints to tests

* fix options config flow title

* changes based on review

* better key name for message when cant connect

* fix missed update to key name

* fix comments

* remove logger from test which was used to debug and update test function names and docstrings to be more accurate

* add __init__.py to vizio tests module

* readded options flow and updated main component to handle options updates, set unique ID to serial, fixes based on review

* pop hass.data in media_player unload instead of in __init__ since it is set in media_player

* update requirements_all and requirements_test_all

* make unique_id key name a constant

* remove additional line breaks after docstrings

* unload entries during test_user_flow and test_import_flow tests to hopefully reduce teardown time

* try to speed up tests

* remove unnecessary code, use event bus to track options updates, move patches to pytest fixtures and fix patch scoping

* fix comment

* remove translations from commit

* suppress API error logging when checking for device availability as it can spam logs

* update requirements_all and requirements_test_all

* dont pass hass to entity since it is passed to entity anyway, remove entity unload from tests, other misc changes from review

* fix clearing listeners

* use config_entry unique ID for unique ID and use config_entry entry ID as update signal

* update config flow based on suggested changes

* update volume step on config import if it doesn't match config_entry volume step

* update config_entry data and options with new volume step value

* copy entry.data and entry.options before updating when updating config_entry

* fix test_import_entity_already_configured
2020-01-15 11:43:55 +01:00
Raman Gupta d25aa1f183 Convert vizio component from sync to async component (#30605)
* add device_info property and move component to async

* use new VizioAsync class to have proper async support

* remove hass from VizioDevice init since it is not needed

* update requirements_all

* missed type hint

* updates based on review

* pyvizio version bump

* additional fixes based on review

* mistake in last commit

* remove device_info property because it can't be used unless this integration has config flow support
2020-01-10 03:53:47 +01:00
Franck Nijhof b4d6d238e5 Correct names in manifests (T-Z) (#30546) 2020-01-07 14:31:18 +01:00
Raman Gupta a9f6dd698e Remove `suppress_warning` from config options for vizio component (#30536)
* move constants, move schema validation to init, prepare for zeroconf/config flow

* mistake in refactor

* update .coveragerc, move validate_auth to __init__, only attempt to get ESN if device setup is validated

* fix schema validation

* remove suppress warning config option

* remove config_flow from manifest since its not ready yet

* update requirements_all.txt

* fix issue with merge conflict
2020-01-07 13:31:13 +01:00
Raman Gupta 7d58de1bda Update vizio component to prepare for config flow and zeroconf support (#30522)
* move constants, move schema validation to init, prepare for zeroconf/config flow

* update requirements_all and make setup validation more pythonic

* mistake in refactor

* un-revert change from previous PR

* rename schema var

* update .coveragerc, move validate_auth to __init__, only attempt to get ESN if device setup is validated

* reinstate validate_setup but change logic to use new connection test function

* fix schema validation

* simplify string empty check logic

* missed commit
2020-01-06 20:32:31 -05:00
Franck Nijhof a84741392b
Format all manifests with prettier (#30521) 2020-01-06 21:28:23 +01:00
Raman Gupta 2ac5862eda Add unique id property for Vizio devices so they get added to entity registry (#30497)
* add unique id property for Vizio devices so they get added to entity registry

* update requirements

* small change to make code more readable

* update to use f-string for consistency

* fix property name

* set unique_id to none if serial number couldnt be found

* set unique_id to none

* ESN should be globally unique so no device type needed. pyvizio will set ESN to None if ESN is unobtainable
2020-01-05 11:20:06 +01:00
Quentame 193769c791 Move vizio imports at top-level (#29046) 2019-11-25 14:05:46 +01:00
Quentame 3d05228ec1 Move imports in vizio component (#27452) 2019-10-12 14:09:39 +02:00
Franck Nijhof c7da781efc Update documentation link URL for integrations in all manifests (#27114) 2019-10-02 09:25:44 -07:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Jeff Irion 4844477d3a Make sure volume level is valid when incrementing/decrementing (#25061)
* Make sure volume level is not None before incrementing/decrementing

* Pass linting checks
2019-07-10 15:58:29 -07:00
Raman Gupta 620c6a22ac Update vizio component to support latest pyvizio with soundbar support (#22294)
* update vizio component to support latest pyvizio with soundbar support

* Resolved Hound issues

* Additional Hound issue

* Updated based on feedback

* Style updates

* Additional code styling changes

* Added check for auth token not being set for tv device_class

* Limited lines to 80 characters

* moved MAX_VOLUME into base package

* fixed supported commands

* styling changes

* fix styling yet again

* remove unnecessary elif

* removed play/pause since I can't get current state

* changed value access method from config dict

* fixed flake failures

* try to fix docstring

* try to fix docstring

* fixed auth token validation

* rebase and regenerate requirements_all.txt

* updated log text

* line length fix

* added config validation to handle conditionally optional parameter

* updated validate setup log message and string formatting based on review

* fix pylint error

* less ugly
2019-04-18 22:48:05 +02:00
cgtobi 2c07bfb9e0 Remove dependencies and requirements (#23024)
* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit fe7171b4cd.

* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit 391355ee2c.

* Remove dependencies and requirements

* Fix flake8 complaints

* Fix more flake8 complaints

* Revert non-component removals
2019-04-12 10:13:30 -07:00
Paulus Schoutsen cfe4cf30ad
Add manifests (#22699)
* Add manifests

* Update auto name

* Update codeowners

* Add requirements from platforms

* Minor cleanup

* Incorporate changes from awarecan PR
2019-04-03 21:14:45 -07:00
Tobias Sauerwein 048b100eea Clean up docstrings (#22679)
* Clean up docstrings

* Fix long lines

* Fix more docstrings

* Fix more docstrings

* Fix more docstrings
2019-04-03 17:40:03 +02:00
Paulus Schoutsen f5076188ef
Consolidate all platforms that have no tests (#22096)
* Consolidate

* Fix tests

* Update imports

* Fix import

* Use importlib because integration and package share name

* Fix more tests

* Update .coveragerc and CODEOWNERS
2019-03-16 20:44:05 -07:00