Originally posted by Flame
View Post
Dirk
If this is your first visit, be sure to check out the FAQ. You must register before you can post.
IMPORTANT: Your first post will be checked for appropriate content. This may take a bit of time.
Sub LinkAGroupOfZones(ByVal LinkGroupName As String, ByVal SourceZoneName As String, ByVal DestinationZonesString As String)
'Sub LinkAGroupOfZones(ByVal SourceZoneName As String)
Dim pi As Object
'Example Dim LinkgroupName As String = "Test"
'Example Dim SourceZoneName As String = "Family Room"
'Example Dim DestinationZonesString As String = "Master Bedroom;20;1|Kitchen;20;1"
pi = hs.Plugin("SONOSCONTROLLER")
If pi Is Nothing Then
hs.writelog("Script", "empty")
Exit Sub
End If
Try
pi.SetLinkgroupZoneSource(LinkgroupName, SourceZoneName) ' store the zone source info
Catch ex As Exception
hs.writelog("Script", "Error in calling SetLinkgroupZoneSource with error = " & ex.message)
Exit Sub
End Try
Try
pi.SetLinkgroupZoneDestination(LinkgroupName, DestinationZonesString) ' store the zone destination info
Catch ex As Exception
hs.writelog("Script", "Error in calling DestinationZonesString with error = " & ex.message)
Exit Sub
End Try
Try
pi.HandleLinking(LinkgroupName, True) ' Link!
Catch ex As Exception
hs.writelog("Script", "Error in calling HandleLinking with error = " & ex.message)
Exit Sub
End Try
End Sub
Sub UnLinkAGroupOfZones(ByVal LinkGroupName As String)
Dim pi As Object
pi = hs.Plugin("SONOSCONTROLLER")
If pi Is Nothing Then
hs.writelog("Script", "empty")
Exit Sub
End If
Try
pi.HandleLinking(LinkgroupName, False) ' UnLink!
Catch ex As Exception
hs.writelog("Script", "Error in calling HandleLinking with error = " & ex.message)
Exit Sub
End Try
End Sub
Comment