Skip to content

Enums

pyfamilysafety.enum.OverrideTarget

Bases: Enum

Platform target for device limits and override actions.

Attributes:

Name Type Description
DESKTOP

Windows PCs and similar desktop devices.

XBOX

Xbox consoles.

MOBILE

Phones and tablets.

DESKTOP class-attribute instance-attribute

DESKTOP = 0

XBOX class-attribute instance-attribute

XBOX = 1

MOBILE class-attribute instance-attribute

MOBILE = 2

__str__

__str__()
Source code in pyfamilysafety/enum.py
17
18
19
20
21
22
23
24
def __str__(self) -> str:
    if self.name == "DESKTOP":
        return "Desktop"
    if self.name == "MOBILE":
        return "Mobile"
    if self.name == "XBOX":
        return "Xbox"
    return self.name

from_pretty classmethod

from_pretty(pretty)

Parse an API display string into an enum member.

Parameters:

Name Type Description Default
pretty str

One of Desktop, Mobile, or Xbox.

required
Source code in pyfamilysafety/enum.py
26
27
28
29
30
31
32
33
34
35
36
37
38
@classmethod
def from_pretty(cls, pretty: str) -> 'OverrideTarget':
    """Parse an API display string into an enum member.

    Args:
        pretty: One of ``Desktop``, ``Mobile``, or ``Xbox``.
    """
    if pretty == "Desktop":
        return cls.DESKTOP
    if pretty == "Mobile":
        return cls.MOBILE
    if pretty == "Xbox":
        return cls.XBOX

pyfamilysafety.enum.OverrideType

Bases: Enum

How to apply a device override (block or unblock).

Attributes:

Name Type Description
CANCEL

Remove an active block immediately.

UNTIL

Block until a given valid_until datetime.

CANCEL class-attribute instance-attribute

CANCEL = 0

UNTIL class-attribute instance-attribute

UNTIL = 1

__str__

__str__()
Source code in pyfamilysafety/enum.py
50
51
52
53
54
55
def __str__(self) -> str:
    if self.name == "CANCEL":
        return "Cancel"
    if self.name == "UNTIL":
        return "BlockUntil"
    return self.name

pyfamilysafety.enum.DayOfWeek

Bases: Enum

Days used in device limit schedules.

Serialized as lowercase English day names (monday, tuesday, …).

MONDAY class-attribute instance-attribute

MONDAY = 'monday'

TUESDAY class-attribute instance-attribute

TUESDAY = 'tuesday'

WEDNESDAY class-attribute instance-attribute

WEDNESDAY = 'wednesday'

THURSDAY class-attribute instance-attribute

THURSDAY = 'thursday'

FRIDAY class-attribute instance-attribute

FRIDAY = 'friday'

SATURDAY class-attribute instance-attribute

SATURDAY = 'saturday'

SUNDAY class-attribute instance-attribute

SUNDAY = 'sunday'

__str__

__str__()
Source code in pyfamilysafety/enum.py
70
71
def __str__(self) -> str:
    return self.value

pyfamilysafety.enum.DeviceLimitsMode

Bases: Enum

How device limits are applied to a platform schedule.

Attributes:

Name Type Description
PER_DEVICE_TYPE

Limits apply per device type (default API mode).

PER_DEVICE_TYPE class-attribute instance-attribute

PER_DEVICE_TYPE = 'PerDeviceType'

__str__

__str__()
Source code in pyfamilysafety/enum.py
81
82
def __str__(self) -> str:
    return self.value