Commit Graph

18 Commits (e3a3f934415beb195e26317347cfee9af4e95633)

Author SHA1 Message Date
Maciej Bieniek 9dd9147343
Use HA `uuid` as `client_id` in BraviaTV (#79618)
* Use uuid as clientid/nickname

* Fixes after rebase

* Move gen_instance_ids() to utils

* Store client_id and nickname in config_entry

* Update tests

* Clean names

* Rename consts
2022-10-05 11:24:52 +03:00
Maciej Bieniek 3b794038b1
Add reauth flow to BraviaTV integration (#79405)
* Raise ConfigEntryAuthFailed

* Add reauth flow

* Add tests

* Patch pair() method to avoid IO

* Remove unused errors dict
2022-10-02 13:07:57 -07:00
Artem Draft 7c460cc641
Add PSK auth and SSDP discovery to Bravia TV (#77772) 2022-09-23 09:03:43 -04:00
Artem Draft 29be6d17b0
Add is_host_valid util (#76589) 2022-09-11 11:12:04 -05:00
Artem Draft 19295d33ba
Migrate BraviaTV to new async backend (#75727) 2022-08-10 13:11:49 +02:00
Marc Mueller 69e413ac1e
Update pylint to 2.10.1 (#54963)
* Update pylint to 2.10.0

* useless-suppression

* Consider-using-tuple

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Use dict.items()

* Add pylint disable

* Use pylint 2.10.1

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-08-21 10:41:23 +02:00
Maciej Bieniek 0cb61b628d
Improve typing in Sony Bravia TV integration (#52438)
* Strict typing

* Variables typing

* Suggested change

* Fix pylint

* Use suppress instead of try..except

* Remove unused variables

* Suggested change

* Fix pylint

* Fix typing for unique_id
2021-07-03 14:37:54 +01:00
Maciej Bieniek ff8b96c65d
Remove YAML configuration import from Sony Bravia TV (#52141) 2021-06-24 11:10:21 +02:00
Maciej Bieniek 01a26f1348
Remove undo_listener variable in Sony Bravia TV integration (#52033) 2021-06-20 21:39:14 -07:00
Artem Draft db61a773fd
Add remote control platform to BraviaTV (#50845) 2021-06-17 12:33:44 +02:00
Franck Nijhof d4d0b93d3b
Clean up connection classes in integrations A-C (#49888) 2021-04-30 21:01:52 -10:00
Maciej Bieniek 9588e0d35a
Fix `host_valid()` logic in BraviaTV config flow (#49857) 2021-04-29 16:09:59 +02:00
Ville Skyttä dc880118a4
Lint suppression cleanups (#47248)
* Unused pylint suppression cleanups

* Remove outdated pylint bug references

* Add flake8-noqa config and note to run it every now and then

* Add codes to noqa's

* Unused noqa cleanups
2021-03-02 09:02:04 +01:00
David Nielsen a08cb2ca9d
Fix braviatv authentication refresh (#37482)
- Bumps bravia-tv lib to 1.0.6 which fixes is_connected() to actually
      return True only when API is connected, instead of just returning whether
      or not cookies are cached (regardless if they actually worked).
    - Wrap is_connected() because it now performs io.
    - Remove unnecessary logic to refresh cookies. Now that
      is_connected() works, the bravia instance only needs to be
      reconnected when is_connected is False and TV is not off.
2020-07-05 12:02:45 +02:00
Maciej Bieniek 751428fe2b
Catch NoIPControl exception (#36088) 2020-05-25 16:05:52 -04:00
Maciej Bieniek 58bff0a183
Reload braviatv entry after options update (#34576)
* Reload entry after options update

* Undo update listener when unloading
2020-04-29 09:27:45 -05:00
David Nielsen 08e74352ec
Update bravia-tv backend (#34376)
* bravia-tv version bump

* Fix Auth Cookies

    - Fix authentication cookie expiration.
    - Remove obsolete error handling (since bravia-tv==1.0.2)
    - Remove obsolete mac address references. (since bravia-tv==1.0.2)
    - Update tests.

* fix async_refresh_playing_info

* Improve code format

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Config_entry needs mac address for HA restart

    This was mistakenly taken out. Home-Assistant needs to store mac address in
    case restarted. TV needs to be on to acquire mac address. This is neccesary
    to allow TV to be turned on by Home-Assistant after Home-Assistant is
    restarted.

* Skip update() during state changes

    It is best for performance to skip updates during state change because
    bravia.turn_on() will commonly push async_update() beyond it's update
    interval.

* update tests

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-21 16:46:12 +02:00
Maciej Bieniek 6dc6f2d099
Add config flow for braviatv integration (#33774)
* Run scripts

* Improvement strings

* Fix FlowOptions update listener

* Update .ceveragerc

* Add tests

* Better strings

* Add test for OptionsFlow

* Run gen_requirements_all.py once again

* Fix pylint errors

* Log error when there is no bravia.conf file during import

* Improvement strings

* Use braviarc object from hass.data in options flow

* Use async_add_executor_job for IO

* Fix options flow test

* Fix tests

* Remove host_reachable method

* Remove dependencies

* Change setup_platform method to async

* Remove calling system_info

* Save mac in the config entry

* Fix get ignore sources

* Fix read config from file

* Remove the side effect from init

* Fix user_input for user step

* Switch OrderedDict to dict

* New config_entry instance for each test

* Revert change

* Patch async_setup_entry in test_import

* Change a way to create source list

* Consolidate repeated block of code

* Update tests

* Suggested change

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Suggested channge

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Suggested change

* Patch async_setup_entry

* Remove unnecesary if

* suggested change

* Suggested change

* Fix tests

* Fix pylint error

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-15 01:04:06 +02:00