Add binary sensor platform to PlayStation Network Integration#147639
Conversation
|
Hey there @tr4nt0r, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
a4179d3 to
af712bf
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds the binary sensor platform to the PlayStation Network integration, providing subscription status as a binary sensor.
Key changes:
- Introduced
binary_sensor.pyand a sharedentity.pyto DRY up sensor and binary sensor entities. - Updated
__init__.py,strings.json, andicons.jsonto register and localize the new platform. - Added tests and snapshots for the PlayStation Plus subscription sensor.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/components/playstation_network/test_binary_sensor.py | New test for binary sensor setup |
| tests/components/playstation_network/snapshots/*.ambr | Updated sensor snapshot and added binary sensor snapshot |
| homeassistant/components/playstation_network/strings.json | Added translations for binary sensor |
| homeassistant/components/playstation_network/icons.json | Added icons for binary sensors |
| homeassistant/components/playstation_network/entity.py | Shared base entity class for service‐based entities |
| homeassistant/components/playstation_network/binary_sensor.py | Binary sensor platform implementation |
| homeassistant/components/playstation_network/sensor.py | Refactored to use shared base entity |
| homeassistant/components/playstation_network/init.py | Registered BINARY_SENSOR platform |
Comments suppressed due to low confidence (2)
tests/components/playstation_network/test_binary_sensor.py:17
- There are no tests covering the 'online_status' binary sensor or the 'off' state for subscription. Add test cases for both states of each binary sensor.
@pytest.fixture(autouse=True)
tests/components/playstation_network/snapshots/test_sensor.ambr:223
- [nitpick] The friendly name uses a hyphen ('Online-ID'), which is unconventional. Use a space ('Online ID') to follow American English style and typical entity naming conventions.
'original_name': 'Online-ID',
frenck
left a comment
There was a problem hiding this comment.
Thanks, @JackJPowell 👍
../Frenck
Proposed change
Adds binary sensor platform to the playstation network integration.
Includes: psn online status and playstation plus subscription status
Documentation PR
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: