Commit graph

45 commits

Author SHA1 Message Date
J. Nick Koston
0a8a5b973a
Fix samsungtv to abort when ATTR_UPNP_MANUFACTURER is missing () 2022-09-21 14:02:54 -04:00
epenet
1b85929617
Adjust async_step_reauth in samsungtv () 2022-06-29 11:46:59 +02:00
epenet
fc8727454a
Use Mapping for async_step_reauth (p-s) () 2022-06-02 14:28:14 +02:00
epenet
8eb4a16a0f
Drop unnecessary async definitions in samsungtv ()
* Drop unnecessary async definitions in samsungtv

* keep prefix
2022-05-18 08:01:28 +02:00
epenet
afe2b71b2e
Update model info from SSDP in SamsungTV ()
* Update model info from SSDP in SamsungTV

* Add tests
2022-05-17 22:49:19 +03:00
epenet
d8d1e98d4e
Fix unique id in SamsungTV config flow ()
* Fix unique id in SamsungTV config flow

* coverage

Co-authored-by: J. Nick Koston <nick@koston.org>
2022-04-11 23:37:05 -10:00
J. Nick Koston
4b5033d08f
Abort samsungtv discovery of legacy devices when unique id not available () 2022-04-05 16:38:55 -07:00
epenet
2bb42f48aa
Add CONF_MODEL to core constants ()
* Add CONF_MODEL to core constants

* Use CONF_MODEL in SamsungTV

Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-03-29 10:01:10 +02:00
J. Nick Koston
6cec53bea1
Add support for finding the samsungtv MainTvAgent service location () 2022-03-27 22:01:07 -10:00
J. Nick Koston
cc75cebfc5
Add support for setting up encrypted samsung tvs from config flow ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-03-27 10:30:45 -10:00
epenet
87378016c1
Add basic support for SamsungTV encrypted models ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-03-22 00:11:41 -10:00
epenet
86b775e46a
Use generic SamsungTVBridge for SamsungTV type hints ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-03-10 07:48:30 -06:00
epenet
9ab56bd5c8
Allow discovery to update invalid unique_id in SamsungTV ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-03-08 22:27:53 +01:00
epenet
6da38d67ff
Simplify SSDP discovery in SamsungTV ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-03-08 08:54:03 +01:00
epenet
e1b57d83c7
Adjust config entry matching in SamsungTV ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-03-08 08:30:11 +01:00
epenet
2d4ccddd99
Fix SSDP unique id in SamsungTV config flow ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-03-08 07:53:59 +01:00
epenet
a60c37cdb8
Expose Samsung wrapper as async ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-02-22 08:31:16 -10:00
epenet
fc3c9b1b4e
Use dataclass properties in samsungtv discovery ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-01 05:42:42 -10:00
epenet
cbab0ba9c0
Drop base ATTR constants in zeroconf ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-01 12:29:41 +01:00
epenet
ec1c52d945
Use dataclass for SsdpServiceInfo ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-29 06:10:07 -10:00
J. Nick Koston
be94ce42a5
Prevent get_mac_address from blocking event loop in samsungtv config flow () 2021-11-24 03:16:09 +01:00
epenet
476a59d248
Adjust async_step_dhcp signature for strict typing ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-16 12:19:50 +01:00
epenet
b3ffc1e183
Adjust async_step_zeroconf signature for strict typing ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-15 18:05:45 +01:00
Marc Mueller
70469e0979
Use assignment expressions 23 () 2021-10-22 11:13:05 +02:00
Simone Chemelli
4160a5ee3b
Strict typing for SamsungTV ()
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-17 18:51:07 -10:00
Simone Chemelli
2025afe14b
Add MAC to SamsungTV when missing ()
* Add MAC when missing

* Fix I/O

* Add test for missing MAC address
2021-07-26 16:43:05 +02:00
Simone Chemelli
13c142a402
Fix Soundbar exclusion from SamsungTV ()
* Improved check

* Fix tests

* Fix logic and tests

* Update tests
2021-07-12 08:58:53 +02:00
J. Nick Koston
a71af8e9d3
Abort samsungtv config flow for existing hosts when the unique id is set ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-06-25 10:31:33 -10:00
J. Nick Koston
5695710463
Add mac address to samsungtv config entry data if missing ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-06-24 08:15:16 -10:00
J. Nick Koston
ab490bc769
Ensure samsungtv reloads after reauth ()
* Ensure samsungtv reloads after reauth

- Fixes a case of I/O in the event loop

* Ensure config entry is reloaded
2021-06-10 19:23:00 +02:00
J. Nick Koston
8c00c24234
Ensure host is always set with samsungtv SSDP discovery ()
There was a case where self._host could have been None
before _async_set_unique_id_from_udn was called

Fixes 
2021-06-06 00:02:36 +02:00
Simone Chemelli
3d8804bbcf
Improve logging for SamsungTV () 2021-06-04 09:02:39 -07:00
J. Nick Koston
b3d826f2e2
Fix samsungtv yaml import without configured name () 2021-05-28 16:06:17 +02:00
Simone Chemelli
b9a0fb93eb
Add samsungtv dhcp and zeroconf discovery ()
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-05-22 10:41:18 -05:00
Franck Nijhof
8eb27374c6
Clean up connection classes in integrations P-S () 2021-04-30 21:04:44 -10:00
Marc Mueller
2956eb0902
Update pylint to 2.7.3 ()
* Update pylint to 2.7.3

* Add class-const-naming-style

* Remove unused-import message

* Additional cleanup
2021-03-29 18:02:56 -10:00
Franck Nijhof
bc1daf1802
None optional hass typing in FlowHandler ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-02-13 13:21:37 +01:00
zetvio
78b4c3981f
Use reference strings in Samsung TV config flow ()
* Use reference strings in samsungtv config flow

* Adjust samsungtv config flow tests
2020-10-05 11:45:35 +02:00
Franck Nijhof
1c2ebdf307
Upgrade black to 20.8b1 () 2020-08-27 13:56:20 +02:00
Franck Nijhof
3cc94f7d6a
ConfigFlow default discovery without unique ID () 2020-06-15 13:38:38 +02:00
Paolo Tuninetto
a8758ed3a1
Add support for newer SamsungTV models ()
* Added support for newer SamsungTV models

* Fixed legacy port

* store token in HA config directory

* Change token name

* rebasing and exception handling

* implement update

* fix error creating mediaplayer

* Debug logging

* Increase timeout

* Restore update timeout

* Store token_file path in config_entry

* Introduction of samsung bridge class

* Added bridge class functions

* Code cleanup

* more fixes

* Begin testing

* samsungtvws 1.2.0

* Config flow tests 0.1

* Fixed some mediaplayer tests

* Fixed fixture in media player

* use of constants and turn off

* more media player tests

* samsungtvws 1.3.1 and other fixes

* WS tv update rewritten

* more tests

* test_init

* fixed tests

* removed reset mock

* tests reset mock

* close_remote and tests

* deprecate port config

* deprecate port config 2

* deprecate port config 3

* save token only if needed

* cleanup

* better websocket protocol detection

* config removal
2020-03-10 11:48:09 +01:00
Paulus Schoutsen
d4615fd432
Freeze config entry data ()
* Freeze config entry data

* Fix mutating entry.data

* Fix config entry options tests
2020-03-09 14:07:50 -07:00
escoand
0823ee4385
Fix exceptions when using newer Samsung TVs ()
* try to fix websocket problems

* use tuple

* catch websocket exceptions

* typo
2020-02-08 12:03:35 +01:00
escoand
4550968316
Samsung TV refinements ()
* use st not deviceType

* show model in flow title

* Update strings.json

* add re-auth to entity

* add re-auth to config_flow

* handle auth popup better

* use media player domain const

* fix tests

* rename not_found to not_successful

* authz not authn

* Update media_player.py

* Update config_flow.py

* Update media_player.py

* Update test_media_player.py

* finalize re-auth

* fix ssd tests

* better naming

* fix ip-address-mock serialization

* fix turn_on_action serialization

* add type of hass object

* fix acces denied test

* remove half-added typing

* async get ip address

* fix pylint
2020-02-03 20:34:02 +01:00
escoand
ef05aa2f39 Add Samsung TV config flow ()
* add config flow

* add tests

* add user step error handling

* remove unload function

* add missing test file

* handle authentication correctly

* remove old discovery mode

* better handling of remote class

* optimized abort messages

* add already configured test for user flow

* Import order

* use ip property instead context

* Black

* small syntax

* use snake_case

* Revert "use ip property instead context"

This reverts commit 91502407eb216f8a0b1b90e3e6fb165b81406f8f.

* disable wrong pylint errors

* disable wrong no-member

* Try to fix review comments

* Try to fix review comments

* Fix missing self

* Fix ip checks

* methods to functions

* simplify user check

* remove user errors

* use async_setup for config

* fix after rebase

* import config to user config flow

* patch all samsungctl

* fix after rebase

* fix notes

* remove unused variable

* ignore old setup function

* fix after merge

* pass configuration to import step

* isort

* fix recursion

* remove timeout config

* add turn on action (dry without testing)

* use upstream checks

* cleanup

* minor

* correctly await async method

* ignore unused import

* async call send_key

* Revert "async call send_key"

This reverts commit f37057819f.

* fix comments

* fix timeout test

* test turn on action

* Update media_player.py

* Update test_media_player.py

* Update test_media_player.py

* use async executor

* use newer ssdp data

* update manually configured with ssdp data

* dont setup component directly

* ensure list

* check updated device info

* Update config_flow.py

* Update __init__.py

* fix duplicate check

* simplified unique check

* move method detection to config_flow

* move unique test to init

* fix after real world test

* optimize config_validation

* update device_info on ssdp discovery

* cleaner update listener

* fix lint

* fix method signature

* add note for manual config to confirm message

* fix turn_on_action

* pass script

* patch delay

* remove device info update
2020-01-10 03:19:10 +01:00