* Remove unnecessary exception re-wraps
* Preserve exception chains on re-raise
We slap "from cause" to almost all possible cases here. In some cases it
could conceivably be better to do "from None" if we really want to hide
the cause. However those should be in the minority, and "from cause"
should be an improvement over the corresponding raise without a "from"
in all cases anyway.
The only case where we raise from None here is in plex, where the
exception for an original invalid SSL cert is not the root cause for
failure to validate a newly fetched one.
Follow local convention on exception variable names if there is a
consistent one, otherwise `err` to match with majority of codebase.
* Fix mistaken re-wrap in homematicip_cloud/hap.py
Missed the difference between HmipConnectionError and
HmipcConnectionError.
* Do not hide original error on plex new cert validation error
Original is not the cause for the new one, but showing old in the
traceback is useful nevertheless.
* Rewrite parts of upnp component
* Linting
* Add SCAN_INTERVAL
* Get values simultaneously
* Move to time related constants, as per #32065
* Linting
* Move constant KIBIBYTE to homeassistant.const
* Simplify code
* Fix tests for #33344
* Changes after review
* Update homeassistant/components/upnp/sensor.py
* Changes after review
* Formatting
* Formatting
* Use ST from discovery info to avoid swapping device_types if device advertises multiple versions
* Linting
* Requirements for upnp + dlna_dmr components
* Linting
* Regen requirements
* Changes after review by @MartinHjelmare
* Changes after review by @MartinHjelmare
* Formatting
* Linting
* Changes after review by @MartinHjelmare
* Changes after review by @MartinHjelmare
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Change datetime.now() to dt_util.now() in cases where the functionality should stay the same
These changes should not affect the functionality, rather cleanup our codebase.
In general we would like integrations to not to use datetime.now() unless there's a very good
reason for it, rather use our own dt_util.now() which makes the code aware of our current time
zone.
* Use datetime.utcnow() for season sensor to get offset-naive utc time
* Revert "Use datetime.utcnow() for season sensor to get offset-naive utc time"
This reverts commit 5f36463d9c7d52f8e11ffcec7e57dfbc7b21bdd1.
* BOM sensor last_updated should be UTC as well
* Run black
* Remove unused last_partition_update variable
* Consolidate
* Fix tests
* Update imports
* Fix import
* Use importlib because integration and package share name
* Fix more tests
* Update .coveragerc and CODEOWNERS