Livewire-Simple-Delegation-Switcher
Livewire-Simple-Delegation-Switcher copied to clipboard
Config Option: Source Backfeed Multicast IP
From emails with John Hengesbach. He wants to be able to put a Backfeed Multicast IP address into the 'LWNumber' field. This proposed change will fix this (and he has it running himself), but I need to do some testing myself before merging it into the main app.
Original code at line 183-193:
self.LWRP_Sources.append(
{
"ButtonLabel": source['Name'],
"LWNumber": int(source['SourceNum']),
"LWMulticastNumber": AxiaLivewireAddressHelper.streamNumToMulticastAddr(source['SourceNum']),
"LWSipAddress": None,
"GPIOTriggers": [],
"DisableRouteChange": False,
"GPI_IndicationOnly": False,
}
)
Change it to this:
# check to see if we have a "multicast" number in the
# SourceNum field. If so, we can use this and calculate
# the channel number to keep everybody happy.
my_multicast_number = source['SourceNum'].split(".")
if (my_multicast_number[0] == "239"):
# new way, use the SourceNum as the multicast number directly and reverse translate it to get the SourceNum
my_LWNumber = AxiaLivewireAddressHelper.multicastAddrToStreamNum(source['SourceNum'])
my_LWMulticastNumber = source['SourceNum']
else:
# original way...
my_LWNumber = int(source['SourceNum'])
my_LWMulticastNumber = AxiaLivewireAddressHelper.streamNumToMulticastAddr(int(source['SourceNum']))
self.LWRP_Sources.append(
{
"ButtonLabel": source['Name'],
"LWNumber": my_LWNumber,
"LWMulticastNumber": my_LWMulticastNumber,
"LWSipAddress": None,
"GPIOTriggers": [],
"DisableRouteChange": False,
"GPI_IndicationOnly": False,
}
)