ambient-weather-scala


License

License

Categories

Categories

Scala Languages
GroupId

GroupId

org.overbeck
ArtifactId

ArtifactId

ambient-weather-scala_2.12
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

ambient-weather-scala
ambient-weather-scala
Project URL

Project URL

https://overbeck.org
Project Organization

Project Organization

org.overbeck
Source Code Management

Source Code Management

https://github.com/coverbeck/ambient-weather-scala/

Download ambient-weather-scala_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/org.overbeck/ambient-weather-scala_2.12/ -->
<dependency>
    <groupId>org.overbeck</groupId>
    <artifactId>ambient-weather-scala_2.12</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.overbeck/ambient-weather-scala_2.12/
implementation 'org.overbeck:ambient-weather-scala_2.12:0.0.1'
// https://jarcasting.com/artifacts/org.overbeck/ambient-weather-scala_2.12/
implementation ("org.overbeck:ambient-weather-scala_2.12:0.0.1")
'org.overbeck:ambient-weather-scala_2.12:jar:0.0.1'
<dependency org="org.overbeck" name="ambient-weather-scala_2.12" rev="0.0.1">
  <artifact name="ambient-weather-scala_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.overbeck', module='ambient-weather-scala_2.12', version='0.0.1')
)
libraryDependencies += "org.overbeck" % "ambient-weather-scala_2.12" % "0.0.1"
[org.overbeck/ambient-weather-scala_2.12 "0.0.1"]

Dependencies

compile (3)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.13
com.lihaoyi : requests_2.12 jar 0.6.5
com.lihaoyi : upickle_2.12 jar 1.2.2

test (1)

Group / Artifact Type Version
com.lihaoyi : utest_2.12 jar 0.7.5

Project Modules

There are no modules declared in this project.

ambient-weather-scala

A Scala library for the Ambient Weather API.

There is already a Ambient Java API, but I wanted to try it in Scala.

Usage

You need an API key and an App key from Ambient Weather

 val appKey = "12345"
 val apiKey = "abcde"
 val aw = AmbientWeather(appKey, apiKey)
 # Get all weather devices
 val devicesTry: Try[Seq[DeviceData]] = aw.devices
 devicesTry
    .map(devices => devices
        .foreach(device => println(aw.deviceData(device.macAddress))))

Limitations

  • Using uPickle for JSON serialization, which has an out of the box limit of 64 fields in a case class. Device Data can have more than 64 fields, so I just commented out several.
  • I only have one Ambient Weather Device to try this on, so the Option fields are the ones that don't appear for my device, the WS-2902C.
  • No logging

Versions

Version
0.0.1