From 4cd9b1ed8fefaffc743d254b639e09233e6ce754 Mon Sep 17 00:00:00 2001 From: Normen Hansen Date: Mon, 21 Jul 2025 22:03:15 +0200 Subject: [PATCH] fix add/remove subscription with ip address --- netaudio/console/commands/subscription/_add.py | 5 +++-- netaudio/console/commands/subscription/_remove.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/netaudio/console/commands/subscription/_add.py b/netaudio/console/commands/subscription/_add.py index 28ce537..bcd4a00 100644 --- a/netaudio/console/commands/subscription/_add.py +++ b/netaudio/console/commands/subscription/_add.py @@ -1,4 +1,5 @@ import asyncio +import ipaddress from cleo.commands.command import Command from cleo.helpers import option @@ -43,7 +44,7 @@ async def subscription_add(self): elif self.option("tx-device-host"): tx_device = next( filter( - lambda d: d[1].ipv4 == self.option("tx-device-host"), + lambda d: d[1].ipv4 == ipaddress.ip_address(self.option("tx-device-host")), dante_devices.items(), ) )[1] @@ -75,7 +76,7 @@ async def subscription_add(self): elif self.option("rx-device-host"): rx_device = next( filter( - lambda d: d[1].ipv4 == self.option("rx-device-host"), + lambda d: d[1].ipv4 == ipaddress.ip_address(self.option("rx-device-host")), dante_devices.items(), ) )[1] diff --git a/netaudio/console/commands/subscription/_remove.py b/netaudio/console/commands/subscription/_remove.py index 5fc3c06..98ae6e3 100644 --- a/netaudio/console/commands/subscription/_remove.py +++ b/netaudio/console/commands/subscription/_remove.py @@ -1,4 +1,5 @@ import asyncio +import ipaddress from cleo.commands.command import Command from cleo.helpers import option @@ -37,7 +38,7 @@ async def subscription_add(self): elif self.option("rx-device-host"): rx_device = next( filter( - lambda d: d[1].ipv4 == self.option("rx-device-host"), + lambda d: d[1].ipv4 == ipaddress.ip_address(self.option("rx-device-host")), dante_devices.items(), ) )[1]