GSSDP.ResourceGroup¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Whether this group of resources is available or not. |
||
r/w/co |
The associated client. |
||
r/w |
The number of seconds advertisements are valid. |
||
r/w |
The minimum number of milliseconds between SSDP messages. |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class GSSDP.ResourceGroup(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Class for controlling resource announcement.
A
GSSDP.ResourceGroup
is a group of SSDP resources whose availability can be controlled as one. This is useful when one needs to announce a single service as multiple SSDP resources (UPnP does this for example).- classmethod new(client)¶
- Parameters:
client (
GSSDP.Client
) – TheGSSDP.Client
to associate with- Returns:
A new
GSSDP.ResourceGroup
object.- Return type:
- add_resource(target, usn, locations)¶
- Parameters:
- Returns:
The ID of the added resource.
- Return type:
Add an additional resource to announce in this resource group.
Adds a resource with target target, USN usn, and locations locations to self. If the resource group is set [propertyGSSDP.ResourceGroup:available], it will be announced right away.
If your resource only has one location, you can use [methodGSSDP.ResourceGroup.add_resource_simple] instead.
The resource id that is returned by this function can be used with [methodGSSDP.ResourceGroup.remove_resource].
- add_resource_simple(target, usn, location)¶
- Parameters:
- Returns:
The ID of the added resource.
- Return type:
Adds a resource with target target, USN usn, and location location to self. If the resource group is set [propertyGSSDP.ResourceGroup:available], it will be announced right away.
The resource id that is returned by this function can be used with [methodGSSDP.ResourceGroup.remove_resource].
- get_client()¶
- Returns:
The
GSSDP.Client
self is associated with.- Return type:
- remove_resource(resource_id)¶
- Parameters:
resource_id (
int
) – The ID of the resource to remove
Removes the resource with ID resource_id from self.
- set_available(available)¶
-
Sets self s availability to available. Changing self s availability causes it to announce its new state to listening SSDP clients.
- set_max_age(max_age)¶
- Parameters:
max_age (
int
) – The number of seconds advertisements are valid
Sets the number of seconds advertisements are valid to max_age.
Property Details¶
- GSSDP.ResourceGroup.props.available¶
-
Whether this group of resources is available or not.
- GSSDP.ResourceGroup.props.client¶
- Name:
client
- Type:
- Default Value:
- Flags:
The
GSSDP.Client
to use.
- GSSDP.ResourceGroup.props.max_age¶
-
The number of seconds our advertisements are valid.