Commit Graph

9 Commits (e94228fddfc5215055afaeb30dd0b39110447ceb)

Author SHA1 Message Date
Franck Nijhof d33cf28936
Add check executables have shebangs (in pre-commit and CI) (#33703)
* Add check executables have shebangs (in pre-commit and CI)

* Fix file permissions

* Adjust Azure Pipelines
2020-04-05 18:45:43 +02:00
Franck Nijhof 39336d3ea3
Add prettier (in pre-commit and CI) (#33693)
* Add prettier (in pre-commit and CI)

* Make all file prettier

* Change order

* Add to Azure Pipelines

* Fix a YAML file prettier caught as invalid

* Remove flow mapping using curly braces from all YAML service files
2020-04-05 17:27:16 +02:00
Paulus Schoutsen f1d3c0d19b
Remove unused manifest fields (#33595) 2020-04-03 12:58:19 -07:00
FlavorFx b7dd8cdf50
Add unique id and show on map option in Tankerkoenig (#33400)
* Add unique id to set friendly name by UI

* Add ShowOnMap flag to show each/hide entity on map

* Update homeassistant/components/tankerkoenig/sensor.py

Co-Authored-By: guillempages <guillempages@users.noreply.github.com>

* Update homeassistant/components/tankerkoenig/sensor.py

Co-Authored-By: guillempages <guillempages@users.noreply.github.com>

* Update homeassistant/components/tankerkoenig/sensor.py

Co-Authored-By: guillempages <guillempages@users.noreply.github.com>

* Update homeassistant/components/tankerkoenig/sensor.py

Co-Authored-By: guillempages <guillempages@users.noreply.github.com>

* Update homeassistant/components/tankerkoenig/sensor.py

* Update homeassistant/components/tankerkoenig/__init__.py

* Update homeassistant/components/tankerkoenig

* Update homeassistant/components/tankerkoenig

* Update homeassistant/components/tankerkoenig/sensor.py

* Update homeassistant/components/tankerkoenig/sensor.py

Co-authored-by: guillempages <guillempages@users.noreply.github.com>
2020-04-03 08:14:42 -05:00
guillempages 99d732b974
Revert "Validate UUID for tankerkoenig (#32805)" (#33123)
This reverts commit 49c2a4a4e3.
The validation was causing more problems than it was fixing, so removed
it completely
2020-03-21 17:48:18 -07:00
guillempages 79f6d55fe8
Fix tankerkoenig with more than 10 stations (#33098)
* Fix tankerkoenig with more than 10 stations

There seemed to be a problem, if more than 10 fuel stations were tracked.
Added a warning in this case, and split the calls to the API in chunks of
10, so that the data can be fetched anyway.

* Update homeassistant/components/tankerkoenig/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-21 15:12:14 -07:00
guillempages 49c2a4a4e3
Validate UUID for tankerkoenig (#32805)
* Validate UUIDs against custom validator

Instead of just validating against strings, use a custom validator,
so that the format can be checked.

* Add tests for custom UUID4 validator
2020-03-21 09:43:12 -05:00
Paulus Schoutsen b27c46750c
Update error handling in update coordinator (#32452) 2020-03-04 08:05:46 -08:00
guillempages f53c94ed2a
Add Tankerkoenig integration (#28661)
* Initial version

Parse configuration, but return a fixed value

* Add basic functionality

Request real data from the server
Currently the prices are not getting updated, but the petrol station
data is real

* Update values regularly

The tankerkoenig values get updated regularly with real data.

* Move base functionality for the sensor to a base class

And move that to an own file, so that it can be inherited

* Reduce calls to tankerkoenig api

Use a master/slave concept for sensors; one master gets the data and
updates it into the slaves.

* Update requirements files

* Update all gas stations at once

* Remove tests directory

Currently there are no tests for the integration; will be added in
a future commit.

* Fix slaves not being updated

Let the base class regularly poll, so that slaves are also updated

* Refactor entity creation

Create an auxiliary method to add a station to the entity list,
in preparation to allowing extra stations.

* Add possibility to manually add stations

Add a new configuration option "stations" to manually add extra stations

* Fix style issues

Make the code more pythonic

* Remove redundant code

Implement suggestions from the code review

* Change to platform component

Remove the master/slave concept, in favor of a platform with dummy sensors.
The platform takes care of contacting the server and fetching updates
atomically, and updating the data on the sensors.

* Rename ATTR_STATE

Rename the attribute to "IS_OPEN", to avoid confusion with the sensor state.

* Minor updates

Combine two consecutive error logs into a single one.
Update the sensor's icon

* Separate address into different fields

* Style updates

Use "[]" syntax instead of ".get()" for required parameters
Use warning log level for not available fuel types

* Implement review comments

Fix style issues
Improve error messages
Remove redundant options

* Refactor using DataUpdateCoordinator

Use the new DataUpdateCoordinator to fetch the global data from
the API, instead of implementing an own method.
Also fix comments from the PR

* Implement PR comments

Implement suggestions to improve code readability and keep the Home Assistant style.
Also separate fetching data to an async thread
2020-03-01 16:49:07 +01:00