From 25d8cba118ba4db4b47687dcbc6353cef8f6ddc8 Mon Sep 17 00:00:00 2001 From: Sam Stenvall Date: Thu, 5 Sep 2024 20:22:28 +0300 Subject: [PATCH 1/3] Run ruff check as a GitHub action --- .github/workflows/ruff.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/workflows/ruff.yaml diff --git a/.github/workflows/ruff.yaml b/.github/workflows/ruff.yaml new file mode 100644 index 0000000..b6690e0 --- /dev/null +++ b/.github/workflows/ruff.yaml @@ -0,0 +1,8 @@ +name: Ruff +on: [push, pull_request] +jobs: + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: chartboost/ruff-action@v1 \ No newline at end of file From 8ada35abb0a0556fd212d9d6c517946c38193982 Mon Sep 17 00:00:00 2001 From: Sam Stenvall Date: Thu, 5 Sep 2024 20:23:55 +0300 Subject: [PATCH 2/3] Untrack WIP test client --- client.py | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 client.py diff --git a/client.py b/client.py deleted file mode 100644 index 866c6d0..0000000 --- a/client.py +++ /dev/null @@ -1,41 +0,0 @@ -import asyncio -from time import sleep - -from custom_components.vinx.lw3 import LW3 - - -async def main(): - lw3 = LW3('office-assistant.nitor.zone', 61075) - await lw3.connect() - - device_info = { - 'product_name': str(await lw3.get_property('/.ProductName')), - 'serial_number': str(await lw3.get_property('/.SerialNumber')), - 'mac_address': str(await lw3.get_property('/.MacAddress')), - } - - print(device_info) - - signal_present = await lw3.get_property('/MEDIA/VIDEO/I1.SignalPresent') - print(signal_present.__dict__) - - video_channel_id = await lw3.get_property('/SYS/MB/PHY.VideoChannelId') - print(video_channel_id.__dict__) - - print('sleeping 5 sec') - sleep(5) - - print('changing to 5') - video_channel_id = await lw3.set_property('/SYS/MB/PHY.VideoChannelId', '5') - print(video_channel_id.__dict__) - - print('changing back to 2') - video_channel_id = await lw3.set_property('/SYS/MB/PHY.VideoChannelId', '2') - print(video_channel_id.__dict__) - #try: - # await lw3.get_property('/Foo') - #except ValueError as e: - # print('caught error', e) - - -asyncio.run(main()) From 10dcb36a7c99692ad195164469af0123d4b001b4 Mon Sep 17 00:00:00 2001 From: Sam Stenvall Date: Thu, 5 Sep 2024 20:25:44 +0300 Subject: [PATCH 3/3] Don't run action twice on PRs --- .github/workflows/ruff.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ruff.yaml b/.github/workflows/ruff.yaml index b6690e0..68bfa4a 100644 --- a/.github/workflows/ruff.yaml +++ b/.github/workflows/ruff.yaml @@ -1,5 +1,9 @@ name: Ruff -on: [push, pull_request] +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] jobs: ruff: runs-on: ubuntu-latest