Allow camera usage with HA cloud (#56533)

This commit is contained in:
Tobias Sauerwein 2021-09-22 16:54:12 +02:00 committed by GitHub
parent e34c985534
commit 2478ec887a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 9 deletions

View File

@ -52,11 +52,6 @@ async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
) -> None:
"""Set up the Netatmo camera platform."""
if "access_camera" not in entry.data["token"]["scope"]:
_LOGGER.info(
"Cameras are currently not supported with this authentication method"
)
data_handler = hass.data[DOMAIN][entry.entry_id][DATA_HANDLER]
await data_handler.register_data_class(

View File

@ -50,6 +50,8 @@ class NetatmoFlowHandler(
def extra_authorize_data(self) -> dict:
"""Extra data that needs to be appended to the authorize url."""
scopes = [
"access_camera",
"access_presence",
"read_camera",
"read_homecoach",
"read_presence",
@ -61,10 +63,6 @@ class NetatmoFlowHandler(
"write_thermostat",
]
if self.flow_impl.name != "Home Assistant Cloud":
scopes.extend(["access_camera", "access_presence"])
scopes.sort()
return {"scope": " ".join(scopes)}
async def async_step_user(self, user_input: dict | None = None) -> FlowResult: