Commit Graph

24 Commits (f0ec1235b1f65e985393ddeaea1df439849e3612)

Author SHA1 Message Date
elmurato 7b32e4142e
Make API init async in Minecraft Server (#105403)
* Make api init async

* Remove duplicate assignment of address and set server to None in constructor
2023-12-09 21:15:48 -08:00
Jan-Philipp Benecke 9326ea09a5
Update m* tests to use entity & device registry fixtures (#103980) 2023-11-15 10:33:11 +01:00
elmurato faa149b71a
Add binary sensor tests to Minecraft Server (#102457) 2023-10-21 15:49:38 +02:00
elmurato 9f3a733f73
Add sensor tests to Minecraft Server (#102418) 2023-10-21 15:19:32 +02:00
elmurato 7cd376574e
Reach full init test coverage in Minecraft Server (#102013)
* Add full init test coverage

* Fix patch location

* Use contant for test unique ID
2023-10-17 07:49:05 -07:00
elmurato 4130980100
Patch library instead of own code in Minecraft Server config flow tests (#102018)
* Patch library instead of own code in config flow tests

* Fix patch location
2023-10-16 14:06:22 -07:00
elmurato 370e3166ee
Add diagnostics support in Minecraft Server (#101787)
* Add diagnostics support

* Return diagnostics dict directly

* Use syrupy snapshots for assertions in diagnostics test

* Use parametrize for testing diagnostics

* Remove unnecessary side_effect in patch
2023-10-13 15:40:50 +02:00
elmurato c6a3fa30f0
Add support for Minecraft Server Bedrock Edition (#100925) 2023-10-10 08:42:35 +02:00
elmurato 84451e858e
Simplify Minecraft Server SRV handling (#100726) 2023-09-25 17:56:26 +02:00
elmurato f1a70189ac
Clean-up Minecraft Server tests (#100615)
Remove patching of getmac, fix typo
2023-09-19 22:14:21 +02:00
elmurato d59aa958b6
Add tests for Minecraft Server entry migration from v1 to v2 (#99954) 2023-09-08 23:03:27 +02:00
elmurato 7c3605c82e
Use config entry ID as unique ID and remove dependency to getmac in Minecraft Server (#97837)
* Use config entry ID as unique ID

* Add entry migration to v2 and and remove helper module

* Remove unneeded strings

* Add asserts for config, device and entity entries and improve comments

* Add debug log for config entry migration

* Reset config entry unique ID and use config entry ID instead

* Remove unnecessary unique ID debug log

* Revert usage of constants for tranlation keys and use dash as delimiter for entity unique id suffix

* Revert "Revert usage of constants for tranlation keys and use dash as delimiter for entity unique id suffix"

This reverts commit 07de334606054097e914404da04950e952bef6d2.

* Remove unused logger in entity module
2023-09-07 12:22:46 +02:00
Marc Mueller 3ebd7d2fd1
Fix asyncio DeprecationWarning [3.12] (#98989)
* Fix asyncio DeprecationWarning [3.12]

* Use AsyncMock

* Rewrite ffmpeg tests

* Remove test classes

* Rename test file
2023-08-25 12:27:23 +02:00
elmurato 557b6d511b
Improve reading of MOTD and bump mcstatus to 11.0.0 (#95715)
* Improve reading of MOTD, bump mcstatus to 10.0.3 and getmac to 0.9.4

* Revert bump of getmac

* Bump mcstatus to 11.0.0-rc3. Use new MOTD parser.

* Bump mcstatus to 11.0.0
2023-07-24 20:23:11 +02:00
Franck Nijhof 5e81d28116
Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
Franck Nijhof a6244eea28
Search/replace RESULT_TYPE_* by FlowResultType enum (#74656) 2022-07-07 21:28:18 +02:00
jan iversen d76993034e
Replace HomeAssistantType with HomeAssistant for integrations m* - n* (#49566)
* Integration neato: rename HomeAssistantType to HomeAssistant.

* Integration mysensors: rename HomeAssistantType to HomeAssistant.

* Integration mobile_app: rename HomeAssistantType to HomeAssistant.

* Integration minecraft_server: rename HomeAssistantType to HomeAssistant.

* Clean up

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-04-22 22:23:36 +02:00
Franck Nijhof ad13a9295e
Merge multiple context managers in tests (#48146) 2021-03-27 09:17:15 +01:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Paulus Schoutsen ec47216388
Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
Ville Skyttä 435a88636a
Address new issues flagged by flake8 3.8.0a2 (#34964) 2020-04-30 21:37:58 +02:00
elmurato 45241e57ca
Add support for Minecraft SRV records (#32372)
* Added support for Minecraft SRV records

* Switched from dnspython to aiodns, improved server ping and log messages, use address instead of host and port in config flow

* Updated component requirements
2020-03-23 16:51:13 -07:00
elmurato 699d6ad658
Add Minecraft Server Integration (#30992)
* Add Minecraft Server integration

* Add unit test for config flow

* Fixed some review findings and increased unit test coverage

* Fixed docstrings of new test cases

* Removed unnecessary debug log messages

* Added unique IDs and device infos and removed duplicate name validation

* Attempt to fix unit test on CI

* Return state OFF instead of UNAVAILABLE in case connection to server drops

* Added property decorator to server properties, even less debug messages, improved sensor dispatcher connection and other review findings fixed

* Moved special property handling to sensors, fixed name confusion in sensor entity, switch to HA const for scan_interval, simplified building players list string

* Improved periodic update, speeded up unit tests

* Added type hints, added callback decorator to entity update callback, added const.py to unit test exclusions

* Changed state sensor to binary sensor, removed empty unit test file, added constants for icons and units

* Let HA handle unknown state, check for None in description and players list sensor

* Removed periods at end of log messages, removed constant for default host

* Updated requirements_test_pre_commit.txt, fixed codespell findings

* Use localhost as default host

* Removed passing hass to entities, moved log message from init, moved host lower to vol, use proper patch library, patch library instead of own code

* Replaced server properties with global instance attributes, removed config option scan_interval, switch back to async_track_time_interval

* Removed description and players list sensors, added players list as state attributes to online players sensor, raise OSError instead of deprecated IOError, other minor review findings fixed

* Use MAC address for unique_id in case of an IP address as host, added getmac to manifest.json, added invalid_ip to strings.json, added new test cases for changes in config_flow, replace all IOError's with OSError, other review findings fixed

* Removed double assignment

* Call get_mac_address async safe

* Handle unavailable and unknown states to reach silver quality scale, added quality scale to manifest.json
2020-02-08 09:28:35 +01:00