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]