* Run scaffold script
* Update version
* Bump version
* Initial commit
* Move meter and ESIID to device attributes
* Update internal to hourly due to api limit
* Format with Black
* Fix typo
* Update tests
* Update description
* Disable Pylint error
* Don't commit translations
* Remove meter number from sensor name
* Allow multiple meters per account
* Move data updates to a DataUpdateCoordinator
* Use setdefault to setup the component
* Move strings to const.py
* Fix tests
* Remove meter last updated attribute
* Bump smart-meter-texas version
* Fix logger call
Co-authored-by: J. Nick Koston <nick@koston.org>
* Remove unneeded manifest keys
Co-authored-by: J. Nick Koston <nick@koston.org>
* Remove icon property
Co-authored-by: J. Nick Koston <nick@koston.org>
* Handle instance where user already setup an account
Co-authored-by: J. Nick Koston <nick@koston.org>
* Remove icon constant
* Fix indentation
* Handle config flow errors better
* Use ESIID + meter number as unique ID for sensor
* Update config flow tests to reach 100% coverage
* Avoid reading meters on startup
Cherrypick @bdraco's suggestion
* Run scaffold script
* Update version
* Bump version
* Initial commit
* Move meter and ESIID to device attributes
* Update internal to hourly due to api limit
* Format with Black
* Fix typo
* Update tests
* Update description
* Disable Pylint error
* Don't commit translations
* Remove meter number from sensor name
* Allow multiple meters per account
* Move data updates to a DataUpdateCoordinator
* Use setdefault to setup the component
* Move strings to const.py
* Fix tests
* Remove meter last updated attribute
* Bump smart-meter-texas version
* Fix logger call
Co-authored-by: J. Nick Koston <nick@koston.org>
* Remove unneeded manifest keys
Co-authored-by: J. Nick Koston <nick@koston.org>
* Remove icon property
Co-authored-by: J. Nick Koston <nick@koston.org>
* Handle instance where user already setup an account
Co-authored-by: J. Nick Koston <nick@koston.org>
* Remove icon constant
* Fix indentation
* Handle config flow errors better
* Use ESIID + meter number as unique ID for sensor
* Update config flow tests to reach 100% coverage
* Remove unnecessary try/except block
This checks for the same exception just prior in execution on L51.
* Remove unused return values
* Add tests
* Improve tests and coverage
* Use more pythonic control flow
* Remove all uses of hass.data
Co-authored-by: J. Nick Koston <nick@koston.org>
* Move DwdWeatherWarningsAPI to a library hosted on PyPI
PyPI library uses new DWD WFS API
WFS API allows a more detailed query with reduced data sent as return
Change CONF_REGION_NAME from Optional to Required because it was never really optional
Set attribute region_state to "N/A" because it is not available via the new API
Add attributes warning_i_parameters and warning_i_color
* Use constants instead of raw strings
Streamline methods state and device_state_attributes
* Wrap api, use UTC time
* Update homeassistant/components/dwd_weather_warnings/sensor.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/dwd_weather_warnings/manifest.json
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Add config flow to HLK-SW16
* Use entry_id for unique_id
* Add options update capability
* Refactor entry_id under domain
* Remove name from config
* Set options
* Remove options flow
* remove unneccesary else block from validate_input and move domain cleanup to async_unload_entry
* Add tests and config import
* Add back config schema
* Remove config import
* Refactor unload
* Add back config import
* Update coveragerc
* Don't mock validate_input
* Test duplicate configs
* Add import test
* Use patch for timeout test
* Use mock for testing timeout
* Use MockSW16Client for tests
* Check mock_calls count
* Remove unused NameExists exception
* Remove title from strings.json
* Mock setup for import test
* Set PARALLEL_UPDATES for switch
* Move hass.data.setdefault(DOMAIN, {}) to async_setup_entry
* Add new python library
* Update requirements
* Remove old libs
* config flow with client.search_places
* WIP: UI config + weather OK
* WIP: sensors
* WIP: add pressure to weather + available to sensor
* WIP: coordinator next_rain + alert
* Make import step working
* migrate to meteofrance-api v0.0.3
* Create coordinator for rain only if data available in API
* Fix avoid creation of rain sensor when not available.
* Add options flow for forecast mode
* Fix import config causing bug with UI
* Add alert sensor
* Add coastal alerts when available (#5)
* Use meteofrance-api feature branch on Github
* Update unit of next_rain sensor
* Test different type of attibutes
* Typo for attribute
* Next rain sensor device class as timestamp
* Better design for rain entity attributes
* use master branch for meteofrance-api
* time displayed in the HA server timezone.
* fix bug when next_rain_date_locale is None
* Add precipitation and cloud cover sensors
* Add variable to avoid repeating computing
* Apply suggestions from code review
Co-authored-by: Quentame <polletquentin74@me.com>
* Attributes names in const.
* Cleaning
* Cleaning: use current_forecast and today_forecast
* Write state to HA after fetch
* Refactor, Log messages and bug fix. (#6)
* Add messages in log
* Refactor using 'current_forecast'.
* Use % string format with _LOGGER
* Remove inconsistent path
* Secure timestamp value and get current day forecast
* new unique_id
* Change Log message to debug
* Log messages improvement
* Don't try to create weather alert sensor if not in covered zone.
* convert wind speed in km/h
* Better list of city in config_flow
* Manage initial CONF_MODE as None
* Review correction
* Review coorections
* unique id correction
* Migrate from previous config
* Make config name detailed
* Fix weather alert sensor unload (#7)
* Unload weather alert platform
* Revert "Unload weather alert platform"
This reverts commit 95259fdee84f30a5be915eb1fbb2e19fcddc97e4.
* second try in async_unload_entry
* Make it work
* isort modification
* remove weather alert logic in sensor.py
* Refactor to avoid too long code lines
Co-authored-by: Quentin POLLET <polletquentin74@me.com>
* Update config tests to Meteo-France (#18)
* Update meteo_france exception name
* Update MeteoFranceClient name used in tests
* Update 'test_user'
* Make test_user works
* Add test test_user_list
* Make test_import works
* Quick & Dirty fix on exception managment. WIP
* allow to catch MeteoFranceClient() exceptions
* remove test_abort_if_already_setup_district
* bump meteofrance-api version
* We do not need to test Exception in flow yet
* Remove unused data
* Change client1 fixture name
* Change client2 fixture name
* Finish cities step
* Test import with multiple choice
* refactor places
* Add option flow test
Co-authored-by: Quentin POLLET <polletquentin74@me.com>
* Fix errors due to missing data in the API (#22)
* fix case where probability_forecast it not in API
* Workaround for probabilty_forecast data null value
* Fix weather alert sensor added when shouldn't
* Add a partlycloudy and cloudy value options in condition map
* Enable snow chance entity
* fix from review
* remove summary
* Other fix from PR review
* WIP: error if no results in city search
* Add test for config_flow when no result in search
* Lint fix
* generate en.json
* Update homeassistant/components/meteo_france/__init__.py
* Update homeassistant/components/meteo_france/__init__.py
* Update homeassistant/components/meteo_france/__init__.py
* Update homeassistant/components/meteo_france/sensor.py
* Update homeassistant/components/meteo_france/__init__.py
* Update homeassistant/components/meteo_france/__init__.py
* string: city input --> city field
Co-authored-by: Quentin POLLET <polletquentin74@me.com>
* WOLF Smart-set integration
* Removed translations. Changed device class of timestamp. Added new test for unknown exception
* Remove unit_of_measurement from hours sensor
* Code cleanup. Pull Request comments fixes
* ConnectError import change. Removed DEVICE_CLASS_TIMESTAMP
* Add unique id guard with tests. Use common translations. Move device_id resolution to config_flow.
* Remove debug print
* Switch to config flow setup
* Add minimal test for config flow
* Add myself as codeowner and address some review concerns
* Address some further review comments
* Initial commit for Dexcom integration
* Dexcom config flow testing
* Clarify errors during setup
* Resolve minor test issues
* Update sensor availability, resolve linting issues
* Add sensor tests
* Remove title due to 0.109, add abort
* >94.97% codecov/patch
* Move .translations/ to translations/
* Add constants for servers and unit of measurements
* Bump pydexcom version
* Updated domain schema, Dexcom creation
* Support for different units of measurement
* Update tests
* Remove empty items from manifest
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Raise UpdateFailed if fetching new session fails
* Switch everything over to required
* Simplify state information
* Simplify async_on_remove
* Pydexcom package now handles fetching new session
* Only allow config flow
* Remove ternary operator
* Bump version, pydexcom handling session refresh
* Using common strings
* Import from test.async_mock
* Shorten variable names
* Resolve tests after removing yaml support
* Return false if credentials are invalid
* Available seems to handle if data is empty
* Now using option flow, remove handling import
* Add fixture for JSON returned from API
* Overhaul testing
* Revise update options
* Bump pydexcom version
* Combat listener repetition
* Undo update listener using callback
* Change sensor availability to use last_update_success
* Update sensor availability and tests
* Rename test
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* add support for config flow for Plum Lightpad integration
* add support for config flow for Plum Lightpad integration (remove unintended change to requirements_test_all.txt)
* add support for config flow for Plum Lightpad integration (fix lint issues)
* add support for config flow for Plum Lightpad integration (PR feedback)
* add support for config flow for Plum Lightpad integration (fix lint)
* Update homeassistant/components/plum_lightpad/__init__.py
use debug instead of info for logging
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Update homeassistant/components/plum_lightpad/strings.json
switch to use generated references instead of hard-coded strings
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Update homeassistant/components/plum_lightpad/strings.json
switch to use references instead of hard-coded string
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Update homeassistant/components/plum_lightpad/strings.json
removing translated title per suggestion
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Update homeassistant/components/plum_lightpad/strings.json
removing per suggestion
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* remove unnecessary deepcopy
* remove unnecessary logging warning, since ignoring is expected for configuration.yaml scenario
* switch to hass.loop.create_task per PR feedback
* show login errors when configuring integration via UI (PR feedback)
* disable wrongly flag pylint violation
* add except handler to handle connection errors when setting up config flow entry
* address PR feedback regarding exception handling
* Update homeassistant/components/plum_lightpad/config_flow.py
use helper instead of custom code/message-id
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Now supports Hydrawise API v1.4
* Removed dependency and codeowners name.
* Update CODEOWNERS to include hydrawise
* Changes made from review comments.
* Clean up update.
* Added device class for timestamp and switch. Consolodate methods to parent class.
* Cap next_cycle at 2 years to prevent time overflow.
* Addressed review comments.
* Updated DEVICE_MAP and icon() based on review comments.
* Refactor / update Awair integration
This commit does a few things, all in service of making the Awair
integration more modern and reliable. Specifically we do the following:
- Update to python_awair 0.1.1
- Begin using config entries / flow for setting up the integration.
- YAML support is completely removed.
- The integration now allows adding multiple Awair accounts, should a
user wish to do so (I found it _very_ useful in development).
- Group various Awair sensors into devices, using the device registry.
- Renames various sensors and treats the "dust" sensor as a particulate sensor.
- Device update rate-limits are no longer dynamically calculated; the
Awair API now separates rate-limits on a per-device basis.
- Supports sound pressure and illuminance sensors found on some Awair devices.
- We report the "awair index" for certain sensors as part of device_state_attributes.
The "index" is a subjective measure of whether or not a sensor reading
is "good" or "bad" (and to what extent). It's a component of the Awair
score, and it is useful on its own as an input for those who wish to
do things like "display this color if the value is 'bad'".
This is a breaking change, and requires updates to documentation and a
warning in the README. The breaking changes in detail, are:
- Support for all YAML configuration is removed, and users will need to
re-add the integration via the UI.
- We no longer support overriding device discovery via manual
configuration of device UUIDs. This was previously supported because
the Awair API had severe limits on the device list endpoints; however
those have since been removed.
- Gen 1 devices no longer show a "dust" sensor; rather we create a PM2.5
sensor and a PM10 sensor and just keep the values in sync. This better
reflects the sensor capabilities: it can detect particles in a range
from 2.5 -> 10, but cannot differentiate between sizes.
- Sensors are renamed as follows:
- "sensor.devicename_co2" -> "sensor.devicename_carbon_dioxide"
- "sensor.devicename_voc" -> "sensor.devicename_volatile_organic_compounds"
- "sensor.devicename_score" -> "sensor.devicename_air_quality_index"
- I've chosen to call the "Awair Score" an "air quality index" sensor,
because fundamentally the "Awair Score" and other air quality indices
(such as CAQI) do the same thing: they calculate a value based on a
variety of other inputs.
Under the hood, the integration has seen some improvements:
- We use the DataUpdateCoordinator class to handle updates, rather than
rolling our own update class.
- The code no longer tracks availability based on a timestamp returned
from the Awair service; we assert that if we have received a response
and the response has data for our device, then we are available (and
otherwise, not available). We don't need to test the actual Awair API
so heavily.
- Test coverage has been expanded to handle a variety of products that
Awair produces, not just the one I happen to own.
- Test coverage no longer concerns itself with testing behavior that is
now handled by the DataUpdateCoordinator; nor is it concerned with
ensuring that the overall component sets up and registers properly.
These are assumed to be well-tested functionaity of the core and not
things we need to re-test ourselves.
Finally - between library updates and integration updates, this
integration is well-positioned to support future updates. I have a
proof-of-concept patch for device automations, and the underlying
library now supports subclassing authentication (which clears the way
for us to use OAuth authentication for Awair).
* Wrap test fixture in mock_coro
Truthfully I'm not sure why this was passing on my local dev
environment, but I was developing with python 3.8 before. After
installing python 3.7, I was able to reproduce the CI failures and fix
them.
* Fix broken tests after #34901 and/or #34989
* Do not rename sensors so broadly
We're going to keep the sensors named as they were before, pending the
outcome of any decisions around the air_quality component and what names
should be standardized for air-quality-like devices.
If standardized names are selected (which does seem likely), then we
will update this integration to match them - at which point, it would be
a breaking change.
But for now, we'll keep names mostly identical to what users had before.
Notable in this commit is that we generate the entity_id ourselves,
rather than just allowing it to be auto-generated from the name
attribute. This allows us to provide more human friendly names, while
keeping the old format for entity ids. For example, given an Awair
device called "Living Room", we'll generate an entity id of
"sensor.living_room_voc" but show set the name of the device to "Living
Room Volatile organic compounds".
* Support import from config.yaml
We'll create a config entry from config.yaml the first time we're
loaded, and then defer to it from then on.
We ignore all keys other than the access_token, since we no longer need
to deal with per-account rate-limits (rather, everything is per-device
now).
* Add myself to CODEOWNERS
Since I wrote the initial integration, and now this re-write, it feels
appropriate for me to take care of the integration along with `danielsjf`.
* Remove name mangling
* Update homeassistant/components/awair/manifest.json
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/awair/config_flow.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/awair/sensor.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/awair/sensor.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Address some review feedback
* Set up reauth flow in a job, rather than awaiting
* Remove unnecessary title string
* Remove unnecessary config schema checking
As pointed out in review, because this comes in via import from
`configuration.yaml`, we can rely on the `PLATFORM_SCHEMA` validation instead.
* Fix tests
* Set unique_id appropriately for legacy devices
For users who have had this integration already installed (and who have
updated their home assistant installation sometime in recent history),
we want to ensure that unique_id's are set to the same thing as before,
to facilitate the upgrade process.
To do that, we add an additional property to the `SENSOR_TYPES` dict
(`ATTR_UNIQUE_ID`) which allows us to map modern sensor names from
python_awair to what older versions called them - ie: `humidity` ->
`HUMID`. We then use that value when constructing the unique ID. This
should allow users to upgrade and not lose configuration even if entity
IDs would otherwise change (because we have changed the name format that
generates entity IDs).
One note is that for the gen1 `DUST` sensor, we have to treat it
differently. This integration used to call that a "PM2.5" sensor, but
the unique_id generated would be something like `awair_12345_DUST`. So
we special-case that sensor, and do the same thing. We do not need to
special-case the PM10 sensor for gen1 devices, because we didn't create
a PM10 sensor in the past (we do now, because the "DUST" sensor is
really a hybrid PM2.5/PM10 sensor).
* Patch async_setup_entry for two tests
* Update awair config_flow to require / use an email address for unique_id
Also, only start one re-auth flow.
* Add a few more tests, try to get coverage up.
* Add another test
* Move attribution to device_state_attributes
* Don't require email
* Switch from Union[dict, None] to Optional[dict]
* Use a mock where requested
* Fix missing constant rename
* Use async_create_task
* Bump test coverage a bit for config_flow
* s/CONF_UNIQUE_ID/UNIQUE_ID/g
* Add warning about deprecated platform config
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>