Skip to content

Commit

Permalink
Release/2.2.2 (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
karjanme authored Oct 2, 2023
2 parents 01649d6 + 576a20e commit cc66e90
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ This project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

## Release 2.2.2 [2023-10-01]
### Fixed
- Bug with how timezones are applied to observation timestamps

## Release 2.2.1 [2023-10-01]
### Fixed
- Bug with how the observation date/time is read from the response
Expand Down
8 changes: 4 additions & 4 deletions airnowpy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ def _convertResponseToObservation(self,
@staticmethod
def convertLocalTimeZone(localTimeZone: str) -> tzinfo:
if (localTimeZone == 'EST'):
return timezone('Etc/GMT-5')
return timezone('Etc/GMT+5')
if (localTimeZone == 'CST'):
return timezone('Etc/GMT-6')
return timezone('Etc/GMT+6')
if (localTimeZone == 'MST'):
return timezone('Etc/GMT-7')
return timezone('Etc/GMT+7')
if (localTimeZone == 'PST'):
return timezone('Etc/GMT-8')
return timezone('Etc/GMT+8')
raise LookupError("Local Time Zone '" + localTimeZone + "' is not supported.")
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="airnowpy",
version="2.2.1",
version="2.2.2",
description="Python Library for the AirNow API",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
8 changes: 4 additions & 4 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ def _assertObservations(self, observations: List[Observation]) -> None:
self.assertEqual(Category.GOOD, observations[1].category)

def test_convertLocalTimeZone_withGoodTimeZoneString(self):
self.executeConvertLocalTimeZoneTest("EST", timezone("Etc/GMT-5"))
self.executeConvertLocalTimeZoneTest("CST", timezone("Etc/GMT-6"))
self.executeConvertLocalTimeZoneTest("MST", timezone("Etc/GMT-7"))
self.executeConvertLocalTimeZoneTest("PST", timezone("Etc/GMT-8"))
self.executeConvertLocalTimeZoneTest("EST", timezone("Etc/GMT+5"))
self.executeConvertLocalTimeZoneTest("CST", timezone("Etc/GMT+6"))
self.executeConvertLocalTimeZoneTest("MST", timezone("Etc/GMT+7"))
self.executeConvertLocalTimeZoneTest("PST", timezone("Etc/GMT+8"))

def test_convertLocalTimeZone_withBadTimeZoneString(self):
badTimeZoneStr = "PDT"
Expand Down

0 comments on commit cc66e90

Please sign in to comment.