Commit Graph

27 Commits (69bc6bbe489b175bec6441ccc831d6522b77bd67)

Author SHA1 Message Date
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 75faee4f25
Use attrs instead of properties in Bravia TV integration (#52045)
* Use attrs instead of properties

* Revert to using properties for dynamic data

* Move volume_level to coordinator

* Move media_title to coordinator

* Remove unused variables

* Fix variable name

* Revert removed variables
2021-06-23 15:46:28 +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 fcdd8b11a6
Collection of changing entity properties to class attributes - 2 (#51345) 2021-06-01 12:43:55 -07:00
David Nielsen 636528dd2e
Update bravia-tv to 1.0.11 (#50726) 2021-05-17 09:37:13 +02: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
Erik Montnemery 62bc02fdda
Rename MediaPlayerDevice to MediaPlayerEntity (#34592) 2020-04-25 18:00:57 +02: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
springstan 21dfee831f
Clean up access to config in various integrations v3 (#33842) 2020-04-09 09:26:06 +02:00
springstan e3bcfb88e7
Improve string formatting v4 (#33668)
* Improve string formatting v4

* Use normal strings instead of f-strings

* Fix zeroconf test by adding back part of a condition
2020-04-05 16:01:41 +02:00
Maciej Bieniek b60527c986
Change the method of getting the mac address in the braviatv i… (#33567)
* Remove getmac library

* Fix error handling

* Change error handling method
2020-04-03 22:44:28 -07:00
Maciej Bieniek c0315e32bd
Fix source name (#33565) 2020-04-03 16:10:14 +02:00
Maciej Bieniek 5c2bd8b743
Add unique ID propery to braviatv entity (#33037)
* Add unique_id property

* Use cid to generate unique_id

* Remove debug file

* Add _unique_id declaration

* Suggested change

* Remove unused self._id
2020-03-23 22:16:17 +01:00
David Nielsen fc98faa425
Add Media Stop Support to BraviaTV Mediaplayer (#32220)
* Add media_stop to braviatv mediaplayer

* Fix typo in media_stop()

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-03-01 22:07:44 +01:00
dcnielsen90 9821047d75
Replace unmaintained BraviaRC backend with new fork: (#31234)
BraviaRC is currently unmaintained for home-assistant. This commit
    swaps it out with a new fork of BraviaRC called python-bravia-tv.
    This captures all bug fixes from BraviaRC release 3.7 (previously
    linked backend) to right before BraviaRC breaks when used by home-assistant.
    The intent of forking is to be able to continue supporting home-assistant.
    This is not intended to be a one off solution; this new fork will have
    future updates and be maintain as needed.

    This initial commit of python-bravia-tv improves the import process,
    however overall preserves the original API.
    Other fixes include:

    * Fix set-volume slider
    * Better error handling
    * Increase input options

    Resolves: #26351, #30964
    See also: #12577, #14843, #17345, #18245
2020-02-01 18:04:49 +01:00
Ville Skyttä fa4fa30461 Various string cleanups (#30435)
* Remove some unnecessary string concatenations

* Replace some simple str.formats with f-strings

* Replace some string concatenations with f-strings
2020-01-03 14:47:06 +01:00
bouni afbd966ba6 Move imports in braviatv component (#27855)
* Move imports in braviatv component

* import braviarc directly

* fixed import

* directly import BraviaRC
2019-11-16 10:25:25 +01:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Ville Skyttä f1cbb2a0b3
braviatv, nmap_tracker: use getmac for getting MAC addresses (#24628)
* braviatv, nmap_tracker: use getmac for getting MAC addresses

Refs https://github.com/home-assistant/home-assistant/pull/24601

* Move getmac imports to top level
2019-06-20 23:35:02 +03: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
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