Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[airparif] New binding #17625

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

[airparif] New binding #17625

wants to merge 17 commits into from

Conversation

clinique
Copy link
Contributor

@clinique clinique commented Oct 24, 2024

The AirParif binding provides data coming from Air Parif.
This service gives air quality and pollen information for Paris Area

@clinique clinique added new binding If someone has started to work on a binding. For a new binding PR. work in progress A PR that is not yet ready to be merged labels Oct 24, 2024
@clinique clinique self-assigned this Oct 24, 2024
@clinique clinique requested a review from a team as a code owner October 24, 2024 15:40
@clinique clinique removed the work in progress A PR that is not yet ready to be merged label Nov 18, 2024
@clinique clinique requested review from lolodomo and lsiepel November 20, 2024 16:38
@clinique
Copy link
Contributor Author

This is ready to review now. If someone has some spare time... :-)

Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this contribution. Reviewed all files. Don;t forget to run the i18n tool after all comments have been addressed. It already is in a good shape.

| aq-bulletin-tomorrow | pm10-max | Number:Density | R | Maximum level of PM 10 concentration |
| aq-bulletin-tomorrow | pm25-min | Number:Density | R | Minimum level of PM 2.5 concentration |
| aq-bulletin-tomorrow | pm25-max | Number:Density | R | Maximum level of PM 2.5 concentration |
| daily | message | String | R | Today's daily general information ||| daily | tomorrow | String | R | Tomorrow's daily general information |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| daily | message | String | R | Today's daily general information ||| daily | tomorrow | String | R | Tomorrow's daily general information |
| daily | message | String | R | Today's daily general information |
| daily | tomorrow | String | R | Tomorrow's daily general information |

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected.

| oh:airparif:urticaceae | Yes | ![](doc/images/urticaceae.svg) |
| oh:airparif:willow | Yes | ![](doc/images/willow.svg) |
| oh:airparif:wormwood | Yes | ![](doc/images/wormwood.svg) |

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

### Item Configurationn

```java
Example item configuration goes here.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extend with items file and optional sitemap file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Items added.


```java
Example item configuration goes here.
``
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix code close tag

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@Activate
public AirParifHandlerFactory(final @Reference HttpClientFactory httpClientFactory,
final @Reference AirParifDeserializer deserializer) {
this.httpClient = httpClientFactory.getCommonHttpClient();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better to store the factory and each time a Handler is created you can grab the client from the factory

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

updateState(new ChannelUID(pollensGroupUID, CHANNEL_COMMENT), Objects.requireNonNull(
localPollens.getComment().map(comment -> (State) new StringType(comment)).orElse(UnDefType.NULL)));
updateState(new ChannelUID(pollensGroupUID, CHANNEL_BEGIN_VALIDITY), Objects.requireNonNull(
localPollens.getBeginValidity().map(begin -> (State) new DateTimeType(begin)).orElse(UnDefType.NULL)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DateTimeType should be used with an Instant.
For reference: #17725

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed all ZonedDateTimes to Instants

operation = "Rescheduled";
cancelFuture(result);
}
getLogger().info("{} {} in {}", operation, jobName, duration);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
getLogger().info("{} {} in {}", operation, jobName, duration);
getLogger().debug("{} {} in {}", operation, jobName, duration);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

</channel-group-type>

<channel-group-type id="pollutant-mpc">
<label>Pollutant Concentration Information</label>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<label>Pollutant Concentration Information</label>
<label>Pollutant Concentration</label>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Respelled

</channel-group-type>

<channel-group-type id="daily">
<label>Daily information for the region</label>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<label>Daily information for the region</label>
<label>Daily Region Information</label>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Respelled.

</channel-group-type>

<channel-group-type id="dept-pollens">
<label>Pollen information for the department</label>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<label>Pollen information for the department</label>
<label>Department Pollen Information</label>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Respelled.

Signed-off-by: Gaël L'hopital <[email protected]>
Signed-off-by: Gaël L'hopital <[email protected]>
Signed-off-by: Gaël L'hopital <[email protected]>
Signed-off-by: Gaël L'hopital <[email protected]>
Signed-off-by: Gaël L'hopital <[email protected]>
Signed-off-by: Gaël L'hopital <[email protected]>
Signed-off-by: Gaël L'hopital <[email protected]>
Signed-off-by: Gaël L'hopital <[email protected]>
Signed-off-by: Gaël L'hopital <[email protected]>
Bulletproofed icon servlet

Signed-off-by: Gaël L'hopital <[email protected]>
Signed-off-by: Gaël L'hopital <[email protected]>
Signed-off-by: Gaël L'hopital <[email protected]>
Signed-off-by: Gaël L'hopital <[email protected]>
Signed-off-by: Gaël L'hopital <[email protected]>
Signed-off-by: clinique <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new binding If someone has started to work on a binding. For a new binding PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants