Skip to content

Commit

Permalink
List Australia
Browse files Browse the repository at this point in the history
  • Loading branch information
Snuffy2 committed Nov 7, 2024
1 parent 859200f commit 0068048
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The following sensors are supported in all regions:
1. CPAP Mask Leak %
1. CPAP Total myAir Score
1. CPAP Sleep Data Last Collected
1. This is the datetime the CPAP uploaded the most recent data. This is only supported in the Americas
1. This is the datetime the CPAP uploaded the most recent data
1. Most Recent Sleep Date
1. This is the most recent date for which data is available. This will match Current Data Date if you use your CPAP every day. An automation that triggers when these two sensors are different will signal that you have missed a night

Expand All @@ -69,7 +69,7 @@ Each config entry for this integration will create a service called `resmed_myai

This integration was reversed engineered from the myAir website. There are no guarantees that this will continue to work, as this is up to the whims of ResMed. Please DO NOT rely on this for any health-related matters.

This integration currently only connects to the Americas and Europe. If you are in Asia, please open an issue and offer yourself as a test subject.
This integration currently only connects to accounts from North America, Europe, and Australia. If you are in Asia, please open an issue and offer yourself as a test subject.

## Contributions are welcome!

Expand Down
13 changes: 8 additions & 5 deletions custom_components/resmed_myair/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from collections.abc import Mapping
import logging
from collections.abc import Mapping
from typing import Any

import voluptuous as vol
from aiohttp import DummyCookieJar
from aiohttp.client_exceptions import ClientResponseError
from aiohttp.http_exceptions import HttpProcessingError
from homeassistant.config_entries import ConfigEntry, ConfigFlow, ConfigFlowResult
from homeassistant.core import HomeAssistant
from homeassistant.helpers import selector
from homeassistant.helpers.aiohttp_client import async_create_clientsession
import voluptuous as vol

from .client.myair_client import (
AuthenticationError,
Expand Down Expand Up @@ -97,7 +97,7 @@ async def async_step_user(
_LOGGER.debug(f"[async_step_user] device: {redact_dict(device)}")
if "serialNumber" not in device: # type: ignore
raise ParsingError(
f"Unable to get Serial Number from Device Data"
"Unable to get Serial Number from Device Data"
)
serial_number: str = device["serialNumber"] # type: ignore
_LOGGER.info(f"Found device with serial number {serial_number}")
Expand Down Expand Up @@ -152,7 +152,10 @@ async def async_step_user(
selector.TextSelectorConfig(type="password")
),
vol.Required(CONF_REGION, default=REGION_NA): vol.In(
{REGION_NA: "North America", REGION_EU: "EU (Email MFA)"}
{
REGION_NA: "North America and Australia",
REGION_EU: "Europe (Email MFA)",
}
),
}
),
Expand Down Expand Up @@ -261,7 +264,7 @@ async def async_step_reauth_confirm(
)
if "serialNumber" not in device: # type: ignore
raise ParsingError(
f"Unable to get Serial Number from Device Data"
"Unable to get Serial Number from Device Data"
)
serial_number: str = device["serialNumber"] # type: ignore
_LOGGER.info(f"Found device with serial number {serial_number}")
Expand Down

0 comments on commit 0068048

Please sign in to comment.