How to use the pywemo.ouimeaux_device.coffeemaker.CoffeeMakerMode function in pywemo

To help you get started, we’ve selected a few pywemo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pavoni / pywemo / pywemo / ouimeaux_device / coffeemaker.py View on Github external
Brewed = 5
    CleaningBrewing = 6
    CleaningSoaking = 7
    BrewFailCarafeRemoved = 8


MODE_NAMES = {
    CoffeeMakerMode.Refill: "Refill",
    CoffeeMakerMode.PlaceCarafe: "PlaceCarafe",
    CoffeeMakerMode.RefillWater: "RefillWater",
    CoffeeMakerMode.Ready: "Ready",
    CoffeeMakerMode.Brewing: "Brewing",
    CoffeeMakerMode.Brewed: "Brewed",
    CoffeeMakerMode.CleaningBrewing: "CleaningBrewing",
    CoffeeMakerMode.CleaningSoaking: "CleaningSoaking",
    CoffeeMakerMode.BrewFailCarafeRemoved: "BrewFailCarafeRemoved",
}


def attribute_xml_to_dict(xml_blob):
    """Return integer value of Mode from an attributesList blob, if present."""
    xml_blob = "" + xml_blob + ""
    xml_blob = xml_blob.replace(">", ">")
    xml_blob = xml_blob.replace("<", "<")
    result = {}
    attributes = et.fromstring(xml_blob)
    for attribute in attributes:
        # The coffee maker might also send unrelated xml blobs, e.g.:
        # coffee-brewed
        # 
        # so be sure to check the length of attribute
        if len(attribute) >= 2:
github pavoni / pywemo / pywemo / ouimeaux_device / coffeemaker.py View on Github external
PlaceCarafe = 1  # reservoir has water but carafe not present
    RefillWater = 2  # carafe present but reservoir is empty
    Ready = 3
    Brewing = 4
    Brewed = 5
    CleaningBrewing = 6
    CleaningSoaking = 7
    BrewFailCarafeRemoved = 8


MODE_NAMES = {
    CoffeeMakerMode.Refill: "Refill",
    CoffeeMakerMode.PlaceCarafe: "PlaceCarafe",
    CoffeeMakerMode.RefillWater: "RefillWater",
    CoffeeMakerMode.Ready: "Ready",
    CoffeeMakerMode.Brewing: "Brewing",
    CoffeeMakerMode.Brewed: "Brewed",
    CoffeeMakerMode.CleaningBrewing: "CleaningBrewing",
    CoffeeMakerMode.CleaningSoaking: "CleaningSoaking",
    CoffeeMakerMode.BrewFailCarafeRemoved: "BrewFailCarafeRemoved",
}


def attribute_xml_to_dict(xml_blob):
    """Return integer value of Mode from an attributesList blob, if present."""
    xml_blob = "" + xml_blob + ""
    xml_blob = xml_blob.replace(">", ">")
    xml_blob = xml_blob.replace("<", "<")
    result = {}
    attributes = et.fromstring(xml_blob)
    for attribute in attributes:
        # The coffee maker might also send unrelated xml blobs, e.g.:
github pavoni / pywemo / pywemo / ouimeaux_device / coffeemaker.py View on Github external
RefillWater = 2  # carafe present but reservoir is empty
    Ready = 3
    Brewing = 4
    Brewed = 5
    CleaningBrewing = 6
    CleaningSoaking = 7
    BrewFailCarafeRemoved = 8


MODE_NAMES = {
    CoffeeMakerMode.Refill: "Refill",
    CoffeeMakerMode.PlaceCarafe: "PlaceCarafe",
    CoffeeMakerMode.RefillWater: "RefillWater",
    CoffeeMakerMode.Ready: "Ready",
    CoffeeMakerMode.Brewing: "Brewing",
    CoffeeMakerMode.Brewed: "Brewed",
    CoffeeMakerMode.CleaningBrewing: "CleaningBrewing",
    CoffeeMakerMode.CleaningSoaking: "CleaningSoaking",
    CoffeeMakerMode.BrewFailCarafeRemoved: "BrewFailCarafeRemoved",
}


def attribute_xml_to_dict(xml_blob):
    """Return integer value of Mode from an attributesList blob, if present."""
    xml_blob = "" + xml_blob + ""
    xml_blob = xml_blob.replace(">", ">")
    xml_blob = xml_blob.replace("<", "<")
    result = {}
    attributes = et.fromstring(xml_blob)
    for attribute in attributes:
        # The coffee maker might also send unrelated xml blobs, e.g.:
        # coffee-brewed
github pavoni / pywemo / pywemo / ouimeaux_device / coffeemaker.py View on Github external
Brewing = 4
    Brewed = 5
    CleaningBrewing = 6
    CleaningSoaking = 7
    BrewFailCarafeRemoved = 8


MODE_NAMES = {
    CoffeeMakerMode.Refill: "Refill",
    CoffeeMakerMode.PlaceCarafe: "PlaceCarafe",
    CoffeeMakerMode.RefillWater: "RefillWater",
    CoffeeMakerMode.Ready: "Ready",
    CoffeeMakerMode.Brewing: "Brewing",
    CoffeeMakerMode.Brewed: "Brewed",
    CoffeeMakerMode.CleaningBrewing: "CleaningBrewing",
    CoffeeMakerMode.CleaningSoaking: "CleaningSoaking",
    CoffeeMakerMode.BrewFailCarafeRemoved: "BrewFailCarafeRemoved",
}


def attribute_xml_to_dict(xml_blob):
    """Return integer value of Mode from an attributesList blob, if present."""
    xml_blob = "" + xml_blob + ""
    xml_blob = xml_blob.replace(">", ">")
    xml_blob = xml_blob.replace("<", "<")
    result = {}
    attributes = et.fromstring(xml_blob)
    for attribute in attributes:
        # The coffee maker might also send unrelated xml blobs, e.g.:
        # coffee-brewed
        # 
        # so be sure to check the length of attribute
github pavoni / pywemo / pywemo / ouimeaux_device / coffeemaker.py View on Github external
"""Enum to map WeMo modes to human-readable strings."""

    Refill = 0  # reservoir empty and carafe not in place
    PlaceCarafe = 1  # reservoir has water but carafe not present
    RefillWater = 2  # carafe present but reservoir is empty
    Ready = 3
    Brewing = 4
    Brewed = 5
    CleaningBrewing = 6
    CleaningSoaking = 7
    BrewFailCarafeRemoved = 8


MODE_NAMES = {
    CoffeeMakerMode.Refill: "Refill",
    CoffeeMakerMode.PlaceCarafe: "PlaceCarafe",
    CoffeeMakerMode.RefillWater: "RefillWater",
    CoffeeMakerMode.Ready: "Ready",
    CoffeeMakerMode.Brewing: "Brewing",
    CoffeeMakerMode.Brewed: "Brewed",
    CoffeeMakerMode.CleaningBrewing: "CleaningBrewing",
    CoffeeMakerMode.CleaningSoaking: "CleaningSoaking",
    CoffeeMakerMode.BrewFailCarafeRemoved: "BrewFailCarafeRemoved",
}


def attribute_xml_to_dict(xml_blob):
    """Return integer value of Mode from an attributesList blob, if present."""
    xml_blob = "" + xml_blob + ""
    xml_blob = xml_blob.replace(">", ">")
    xml_blob = xml_blob.replace("<", "<")
    result = {}
github pavoni / pywemo / pywemo / ouimeaux_device / coffeemaker.py View on Github external
Refill = 0  # reservoir empty and carafe not in place
    PlaceCarafe = 1  # reservoir has water but carafe not present
    RefillWater = 2  # carafe present but reservoir is empty
    Ready = 3
    Brewing = 4
    Brewed = 5
    CleaningBrewing = 6
    CleaningSoaking = 7
    BrewFailCarafeRemoved = 8


MODE_NAMES = {
    CoffeeMakerMode.Refill: "Refill",
    CoffeeMakerMode.PlaceCarafe: "PlaceCarafe",
    CoffeeMakerMode.RefillWater: "RefillWater",
    CoffeeMakerMode.Ready: "Ready",
    CoffeeMakerMode.Brewing: "Brewing",
    CoffeeMakerMode.Brewed: "Brewed",
    CoffeeMakerMode.CleaningBrewing: "CleaningBrewing",
    CoffeeMakerMode.CleaningSoaking: "CleaningSoaking",
    CoffeeMakerMode.BrewFailCarafeRemoved: "BrewFailCarafeRemoved",
}


def attribute_xml_to_dict(xml_blob):
    """Return integer value of Mode from an attributesList blob, if present."""
    xml_blob = "" + xml_blob + ""
    xml_blob = xml_blob.replace(">", ">")
    xml_blob = xml_blob.replace("<", "<")
    result = {}
    attributes = et.fromstring(xml_blob)
github pavoni / pywemo / pywemo / ouimeaux_device / coffeemaker.py View on Github external
Ready = 3
    Brewing = 4
    Brewed = 5
    CleaningBrewing = 6
    CleaningSoaking = 7
    BrewFailCarafeRemoved = 8


MODE_NAMES = {
    CoffeeMakerMode.Refill: "Refill",
    CoffeeMakerMode.PlaceCarafe: "PlaceCarafe",
    CoffeeMakerMode.RefillWater: "RefillWater",
    CoffeeMakerMode.Ready: "Ready",
    CoffeeMakerMode.Brewing: "Brewing",
    CoffeeMakerMode.Brewed: "Brewed",
    CoffeeMakerMode.CleaningBrewing: "CleaningBrewing",
    CoffeeMakerMode.CleaningSoaking: "CleaningSoaking",
    CoffeeMakerMode.BrewFailCarafeRemoved: "BrewFailCarafeRemoved",
}


def attribute_xml_to_dict(xml_blob):
    """Return integer value of Mode from an attributesList blob, if present."""
    xml_blob = "" + xml_blob + ""
    xml_blob = xml_blob.replace(">", ">")
    xml_blob = xml_blob.replace("<", "<")
    result = {}
    attributes = et.fromstring(xml_blob)
    for attribute in attributes:
        # The coffee maker might also send unrelated xml blobs, e.g.:
        # coffee-brewed
        # 
github pavoni / pywemo / pywemo / ouimeaux_device / coffeemaker.py View on Github external
class CoffeeMakerMode(IntEnum):
    """Enum to map WeMo modes to human-readable strings."""

    Refill = 0  # reservoir empty and carafe not in place
    PlaceCarafe = 1  # reservoir has water but carafe not present
    RefillWater = 2  # carafe present but reservoir is empty
    Ready = 3
    Brewing = 4
    Brewed = 5
    CleaningBrewing = 6
    CleaningSoaking = 7
    BrewFailCarafeRemoved = 8


MODE_NAMES = {
    CoffeeMakerMode.Refill: "Refill",
    CoffeeMakerMode.PlaceCarafe: "PlaceCarafe",
    CoffeeMakerMode.RefillWater: "RefillWater",
    CoffeeMakerMode.Ready: "Ready",
    CoffeeMakerMode.Brewing: "Brewing",
    CoffeeMakerMode.Brewed: "Brewed",
    CoffeeMakerMode.CleaningBrewing: "CleaningBrewing",
    CoffeeMakerMode.CleaningSoaking: "CleaningSoaking",
    CoffeeMakerMode.BrewFailCarafeRemoved: "BrewFailCarafeRemoved",
}


def attribute_xml_to_dict(xml_blob):
    """Return integer value of Mode from an attributesList blob, if present."""
    xml_blob = "" + xml_blob + ""
    xml_blob = xml_blob.replace(">", ">")
    xml_blob = xml_blob.replace("<", "<")
github pavoni / pywemo / pywemo / ouimeaux_device / coffeemaker.py View on Github external
Refill = 0  # reservoir empty and carafe not in place
    PlaceCarafe = 1  # reservoir has water but carafe not present
    RefillWater = 2  # carafe present but reservoir is empty
    Ready = 3
    Brewing = 4
    Brewed = 5
    CleaningBrewing = 6
    CleaningSoaking = 7
    BrewFailCarafeRemoved = 8


MODE_NAMES = {
    CoffeeMakerMode.Refill: "Refill",
    CoffeeMakerMode.PlaceCarafe: "PlaceCarafe",
    CoffeeMakerMode.RefillWater: "RefillWater",
    CoffeeMakerMode.Ready: "Ready",
    CoffeeMakerMode.Brewing: "Brewing",
    CoffeeMakerMode.Brewed: "Brewed",
    CoffeeMakerMode.CleaningBrewing: "CleaningBrewing",
    CoffeeMakerMode.CleaningSoaking: "CleaningSoaking",
    CoffeeMakerMode.BrewFailCarafeRemoved: "BrewFailCarafeRemoved",
}


def attribute_xml_to_dict(xml_blob):
    """Return integer value of Mode from an attributesList blob, if present."""
    xml_blob = "" + xml_blob + ""
    xml_blob = xml_blob.replace(">", ">")
    xml_blob = xml_blob.replace("<", "<")
    result = {}
    attributes = et.fromstring(xml_blob)
    for attribute in attributes: