Weather Status

class nc_py_api.weather_status._WeatherStatusAPI(session: NcSessionBasic)[source]

Class providing the weather status management API on the Nextcloud server.

property available: bool

Returns True if the Nextcloud instance supports this feature, False otherwise.

get_location() WeatherLocation[source]

Returns the current location set on the Nextcloud server for the user.

set_location(latitude: float | None = None, longitude: float | None = None, address: str | None = None) bool[source]

Sets the user’s location on the Nextcloud server.

Parameters:
  • latitude – north-south position of a point on the surface of the Earth.

  • longitude – east-west position of a point on the surface of the Earth.

  • address – city, index(optional) and country, e.g. “Paris, 75007, France”

get_forecast() list[dict][source]

Get forecast for the current location.

get_favorites() list[str][source]

Returns favorites addresses list.

set_favorites(favorites: list[str]) bool[source]

Sets favorites addresses list.

set_mode(mode: WeatherLocationMode) bool[source]

Change the weather status mode.

class nc_py_api.weather_status.WeatherLocation(raw_location: dict)[source]

Class representing information about the user’s location.

latitude: float

Latitude in decimal degree format

longitude: float

Longitude in decimal degree format

address: str

Any approximate or exact address

mode: WeatherLocationMode

Weather status mode

class nc_py_api.weather_status.WeatherLocationMode(value)[source]

Source from where Nextcloud should determine user’s location.

UNKNOWN = 0

Source is not defined

MODE_BROWSER_LOCATION = 1

User location taken from the browser

MODE_MANUAL_LOCATION = 2

User has set their location manually