Skip to content

Commit

Permalink
Release v2.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdwetering committed Sep 1, 2024
2 parents 8dbe72c + aa2548c commit 6296df1
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 30 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Zip custom components dir
working-directory: "custom_components"
run: zip -r huesyncbox.zip huesyncbox/*
working-directory: "custom_components/huesyncbox"
run: zip -r huesyncbox.zip ./*
- name: Create Release
id: create_release
uses: actions/create-release@v1 # Official Github action
Expand All @@ -67,6 +67,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./custom_components/huesyncbox.zip
asset_path: ./custom_components/huesyncbox/huesyncbox.zip
asset_name: huesyncbox.zip
asset_content_type: application/zip
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Custom integration for the Philips Hue Play HDMI Sync Box.

- [About](#about)
- [Behavior](#behavior)
- [Services](#services)
- [Actions](#actions)
- [Updating from before version 2](#updating-from-before-version-20)
- [Installation](#installation)
- [Home Assistant Community Store (recommended)](#home-assistant-community-store-hacs)
Expand Down Expand Up @@ -46,15 +46,15 @@ A few notes on behavior when changing entities. Note that this behavior is just

* Enabling light sync will also power on the box
* Setting sync mode will also power on the box and start light sync on the selected mode
* When you want to change multiple entities the order is important. For example, Intensity applies to the current selected mode. So if you want to change both the `intensity` and `mode` you _first_ have to change the mode and then set the intensity. Otherwise, the intensity is applied to the "old" mode. If you want to avoid ordering issues you can use the `set_sync_state` service which will take care of the ordering and is more efficient than sending everything separately.
* When you want to change multiple entities the order is important. For example, Intensity applies to the current selected mode. So if you want to change both the `intensity` and `mode` you _first_ have to change the mode and then set the intensity. Otherwise, the intensity is applied to the "old" mode. If you want to avoid ordering issues you can use the `set_sync_state` action which will take care of the ordering and is more efficient than sending everything separately.

### Services
### Actions

The integration exposes some additional services.
The integration exposes some additional actions.

For the parameter descriptions use the Services tab in the Home Assistant Developer tools and search for `huesyncbox` in the services list.
For the parameter descriptions use the Actions tab in the Home Assistant Developer tools and search for `huesyncbox` in the actions list.

| Service name | Description |
| Action name | Description |
|---|---|
| set_bridge | Set the bridge to be used by the Philips Hue Play HDMI Syncbox. |
| set_sync_state | Set the state of multiple features of the Philips Hue Play HDMI Syncbox at once. Makes sure everything is set in the correct order and is more efficient compared to using separate commands. |
Expand Down
1 change: 1 addition & 0 deletions custom_components/huesyncbox/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ async def update_device_registry(
sw_version=api.device.firmware_version,
# Uniqueid seems to be the mac. Adding the connection allows other integrations
# like e.g. Mikrotik Router to link their entities to this device
# HA will normalize the mac address
connections={(CONNECTION_NETWORK_MAC, api.device.unique_id)},
)

Expand Down
4 changes: 2 additions & 2 deletions custom_components/huesyncbox/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"aiohuesyncbox"
],
"requirements": [
"aiohuesyncbox==0.0.28"
"aiohuesyncbox==0.0.30"
],
"version": "2.2.3",
"version": "2.2.4",
"zeroconf": [
"_huesync._tcp.local."
]
Expand Down
4 changes: 3 additions & 1 deletion hacs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "Philips Hue Play HDMI Sync Box",
"homeassistant": "2024.7.0",
"render_readme": true,
"homeassistant": "2024.7.0"
"zip_release": true,
"filename": "huesyncbox.zip"
}
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Must be same as in the manifest
aiohuesyncbox==0.0.28
aiohuesyncbox==0.0.30
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def mock_api(hass):
mock_api.device.api_level = 7
mock_api.device.device_type = "HSB1"
mock_api.device.firmware_version = "firmwareversion"
mock_api.device.unique_id = "unique_id"
mock_api.device.unique_id = "123456ABCDEF" # Make sure it resembles real value
mock_api.device.led_mode = 1
mock_api.device.ip_address = "1.2.3.4"
mock_api.device.wifi = Mock(aiohuesyncbox.device.Wifi)
Expand Down Expand Up @@ -130,7 +130,7 @@ async def setup_integration(
minor_version=2,
domain=huesyncbox.DOMAIN,
entry_id=entry_id,
unique_id="unique_id",
unique_id="123456ABCDEF", # Make sure it resembles the real format
title="HUESYNCBOX TITLE",
data={
CONF_HOST: "host_value",
Expand Down
12 changes: 1 addition & 11 deletions tests/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,6 @@ async def test_user_box_connection_errors_during_link(
)
await hass.async_block_till_done()

assert result["type"] == FlowResultType.SHOW_PROGRESS
assert result["step_id"] == "link"
assert result["progress_action"] == "wait_for_button"

# Trigger to get out of progress
result = await hass.config_entries.flow.async_configure(
result["flow_id"],
)
await hass.async_block_till_done()

assert result["type"] == FlowResultType.ABORT
assert result["reason"] == "connection_failed"

Expand Down Expand Up @@ -329,7 +319,7 @@ async def test_zeroconf_already_configured(hass: HomeAssistant, mock_api) -> Non
"name": b"Hue Syncbox Name",
},
"path": "/different",
"uniqueid": "unique_id",
"uniqueid": "123456ABCDEF",
"devicetype": "HSB001",
"name": "Hue Syncbox Name",
},
Expand Down
4 changes: 2 additions & 2 deletions tests/test_coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async def test_update_device_registry_and_config_entry_on_name_change(

# Verify current name
dr = device_registry.async_get(hass)
device = dr.async_get_device(identifiers={(huesyncbox.DOMAIN, "unique_id")})
device = dr.async_get_device(identifiers={(huesyncbox.DOMAIN, "123456ABCDEF")})
assert device is not None
assert device.name == "Name"

Expand All @@ -34,7 +34,7 @@ async def test_update_device_registry_and_config_entry_on_name_change(
await force_coordinator_update(hass)

# Check device registry and config entry got updated
device = dr.async_get_device(identifiers={(huesyncbox.DOMAIN, "unique_id")})
device = dr.async_get_device(identifiers={(huesyncbox.DOMAIN, "123456ABCDEF")})
assert device is not None
assert device.name == "New name"

Expand Down
4 changes: 2 additions & 2 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ async def test_device_info(hass: HomeAssistant, mock_api):
integration = await setup_integration(hass, mock_api)

dr = device_registry.async_get(hass)
device = dr.async_get_device(identifiers={(huesyncbox.DOMAIN, "unique_id")})
device = dr.async_get_device(identifiers={(huesyncbox.DOMAIN, "123456ABCDEF")})

assert device is not None
assert device.name == "Name"
assert device.manufacturer == "Signify"
assert device.model == "HSB1"
assert device.sw_version == "firmwareversion"
assert device.connections == {("mac", "unique_id")}
assert device.connections == {("mac", "12:34:56:ab:cd:ef")}


async def test_handle_authentication_error_during_setup(hass: HomeAssistant, mock_api):
Expand Down

0 comments on commit 6296df1

Please sign in to comment.