pyastroweatherio 0.62.0.dev6__tar.gz → 0.62.0.dev7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (17) hide show
  1. {pyastroweatherio-0.62.0.dev6 → pyastroweatherio-0.62.0.dev7}/PKG-INFO +1 -1
  2. {pyastroweatherio-0.62.0.dev6 → pyastroweatherio-0.62.0.dev7}/pyastroweatherio/helper_functions.py +159 -63
  3. {pyastroweatherio-0.62.0.dev6 → pyastroweatherio-0.62.0.dev7}/pyastroweatherio/models.py +3 -3
  4. {pyastroweatherio-0.62.0.dev6 → pyastroweatherio-0.62.0.dev7}/pyastroweatherio.egg-info/PKG-INFO +1 -1
  5. {pyastroweatherio-0.62.0.dev6 → pyastroweatherio-0.62.0.dev7}/setup.py +1 -1
  6. {pyastroweatherio-0.62.0.dev6 → pyastroweatherio-0.62.0.dev7}/LICENSE +0 -0
  7. {pyastroweatherio-0.62.0.dev6 → pyastroweatherio-0.62.0.dev7}/README.md +0 -0
  8. {pyastroweatherio-0.62.0.dev6 → pyastroweatherio-0.62.0.dev7}/pyastroweatherio/__init__.py +0 -0
  9. {pyastroweatherio-0.62.0.dev6 → pyastroweatherio-0.62.0.dev7}/pyastroweatherio/client.py +0 -0
  10. {pyastroweatherio-0.62.0.dev6 → pyastroweatherio-0.62.0.dev7}/pyastroweatherio/const.py +0 -0
  11. {pyastroweatherio-0.62.0.dev6 → pyastroweatherio-0.62.0.dev7}/pyastroweatherio/dataclasses.py +0 -0
  12. {pyastroweatherio-0.62.0.dev6 → pyastroweatherio-0.62.0.dev7}/pyastroweatherio/errors.py +0 -0
  13. {pyastroweatherio-0.62.0.dev6 → pyastroweatherio-0.62.0.dev7}/pyastroweatherio.egg-info/SOURCES.txt +0 -0
  14. {pyastroweatherio-0.62.0.dev6 → pyastroweatherio-0.62.0.dev7}/pyastroweatherio.egg-info/dependency_links.txt +0 -0
  15. {pyastroweatherio-0.62.0.dev6 → pyastroweatherio-0.62.0.dev7}/pyastroweatherio.egg-info/requires.txt +0 -0
  16. {pyastroweatherio-0.62.0.dev6 → pyastroweatherio-0.62.0.dev7}/pyastroweatherio.egg-info/top_level.txt +0 -0
  17. {pyastroweatherio-0.62.0.dev6 → pyastroweatherio-0.62.0.dev7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyastroweatherio
3
- Version: 0.62.0.dev6
3
+ Version: 0.62.0.dev7
4
4
  Summary: Python Wrapper for 7Timer and Met.no REST API
5
5
  Home-page: https://github.com/mawinkler/pyastroweatherio
6
6
  Author: Markus Winkler
@@ -62,7 +62,9 @@ class AtmosphericRoutines:
62
62
  # #####################################################
63
63
  # Calculate lifted index
64
64
  # #####################################################
65
- async def calculate_lifted_index(self, temperature, altitude, dew_point_temperature, air_pressure_at_sea_level):
65
+ async def calculate_lifted_index(
66
+ self, temperature, altitude, dew_point_temperature, air_pressure_at_sea_level
67
+ ):
66
68
  """Calculate atmospheric lifted index."""
67
69
  # https://en.wikipedia.org/wiki/Lifted_index
68
70
 
@@ -86,7 +88,9 @@ class AtmosphericRoutines:
86
88
 
87
89
  # Calculate actual Vapor Pressure at surface
88
90
  # Checked with https://www.weather.gov/epz/wxcalc_vaporpressure
89
- e = self._calculate_vapor_pressure(dew_point_temperature) # 6.112 * (10 ** (7.5 * (Td - Tn) / (Td - 35.85)))
91
+ e = self._calculate_vapor_pressure(
92
+ dew_point_temperature
93
+ ) # 6.112 * (10 ** (7.5 * (Td - Tn) / (Td - 35.85)))
90
94
 
91
95
  # Calculate Mixing Ratio at Surface in grams per kilogram
92
96
  # Checked with https://www.weather.gov/epz/wxcalc_mixingratio
@@ -188,7 +192,9 @@ class AtmosphericRoutines:
188
192
  )
189
193
 
190
194
  # Convert transparency to magnitude degradation
191
- magnitude_degradation = self._transparency_to_magnitude_degradation(transparency)
195
+ magnitude_degradation = self._transparency_to_magnitude_degradation(
196
+ transparency
197
+ )
192
198
 
193
199
  # _LOGGER.debug(
194
200
  # "Magnitude Degradation: {:.2f} mag (".format(magnitude_degradation)
@@ -261,13 +267,22 @@ class AtmosphericRoutines:
261
267
  # Constants
262
268
  C = 6.5 # 1.7
263
269
 
264
- water_vapor_pressure = self._calculate_water_vapor_pressure(dew_point_temperature, humidity)
270
+ water_vapor_pressure = self._calculate_water_vapor_pressure(
271
+ dew_point_temperature, humidity
272
+ )
265
273
 
266
274
  # adjusted_pressure = air_pressure_at_sea_level * math.exp(-0.00012 * altitude)
267
- adjusted_pressure = self._calculate_adjusted_pressure(air_pressure_at_sea_level, altitude)
275
+ adjusted_pressure = self._calculate_adjusted_pressure(
276
+ air_pressure_at_sea_level, altitude
277
+ )
268
278
  relative_pressure = adjusted_pressure / air_pressure_at_sea_level
269
279
 
270
- seeing_factor = C * (water_vapor_pressure / 10) ** 0.25 * (wind_speed / 10) ** 0.75 * relative_pressure
280
+ seeing_factor = (
281
+ C
282
+ * (water_vapor_pressure / 10) ** 0.25
283
+ * (wind_speed / 10) ** 0.75
284
+ * relative_pressure
285
+ )
271
286
  seeing = 0.98 / seeing_factor
272
287
 
273
288
  # _LOGGER.debug(
@@ -297,9 +312,9 @@ class AtmosphericRoutines:
297
312
  molar_mass_air = 0.02896 # Molar mass of Earth's air in kg/mol
298
313
  gas_constant = 8.31447 # Universal gas constant in J/(mol*K)
299
314
 
300
- pressure_adjusted = pressure_sea_level * (1 - (lapse_rate * altitude) / temperature_sea_level) ** (
301
- (gravity * molar_mass_air) / (gas_constant * lapse_rate)
302
- )
315
+ pressure_adjusted = pressure_sea_level * (
316
+ 1 - (lapse_rate * altitude) / temperature_sea_level
317
+ ) ** ((gravity * molar_mass_air) / (gas_constant * lapse_rate))
303
318
 
304
319
  return pressure_adjusted
305
320
 
@@ -410,7 +425,9 @@ class AtmosphericRoutines:
410
425
  B = 0.00029
411
426
 
412
427
  # Calculate Lifting Condensation Level using the Clausius-Clapeyron equation
413
- lcl = (A * w) / ((air_pressure_at_sea_level - w) * (1 - B * air_pressure_at_sea_level))
428
+ lcl = (A * w) / (
429
+ (air_pressure_at_sea_level - w) * (1 - B * air_pressure_at_sea_level)
430
+ )
414
431
 
415
432
  return lcl
416
433
 
@@ -690,7 +707,9 @@ class AstronomicalRoutines:
690
707
  # Rise and Setting (Civil)
691
708
  try:
692
709
  self._sun_data["next_rising_civil"] = (
693
- self._sun_observer.next_rising(ephem.Sun(), use_center=True).datetime().replace(tzinfo=UTC)
710
+ self._sun_observer.next_rising(ephem.Sun(), use_center=True)
711
+ .datetime()
712
+ .replace(tzinfo=UTC)
694
713
  )
695
714
  except (ephem.AlwaysUpError, ephem.NeverUpError):
696
715
  # Search for the next rising
@@ -701,16 +720,20 @@ class AstronomicalRoutines:
701
720
  timestamp += timedelta(minutes=1440)
702
721
  self._sun_observer.date = timestamp
703
722
  try:
704
- self._sun_data["next_rising_civil"] = self._sun_observer.next_rising(
705
- ephem.Sun(), use_center=True
706
- ).datetime()
723
+ self._sun_data["next_rising_civil"] = (
724
+ self._sun_observer.next_rising(
725
+ ephem.Sun(), use_center=True
726
+ ).datetime()
727
+ )
707
728
  except (ephem.AlwaysUpError, ephem.NeverUpError):
708
729
  continue
709
730
  break
710
731
 
711
732
  try:
712
733
  self._sun_data["next_setting_civil"] = (
713
- self._sun_observer.next_setting(ephem.Sun(), use_center=True).datetime().replace(tzinfo=UTC)
734
+ self._sun_observer.next_setting(ephem.Sun(), use_center=True)
735
+ .datetime()
736
+ .replace(tzinfo=UTC)
714
737
  )
715
738
  except (ephem.AlwaysUpError, ephem.NeverUpError):
716
739
  # Search for the next setting
@@ -721,9 +744,11 @@ class AstronomicalRoutines:
721
744
  timestamp += timedelta(minutes=1440)
722
745
  self._sun_observer.date = timestamp
723
746
  try:
724
- self._sun_data["next_setting_civil"] = self._sun_observer.next_setting(
725
- ephem.Sun(), use_center=True
726
- ).datetime()
747
+ self._sun_data["next_setting_civil"] = (
748
+ self._sun_observer.next_setting(
749
+ ephem.Sun(), use_center=True
750
+ ).datetime()
751
+ )
727
752
  except (ephem.AlwaysUpError, ephem.NeverUpError):
728
753
  continue
729
754
  break
@@ -735,7 +760,9 @@ class AstronomicalRoutines:
735
760
 
736
761
  try:
737
762
  self._sun_data["next_rising_nautical"] = (
738
- self._sun_observer_nautical.next_rising(ephem.Sun(), use_center=True).datetime().replace(tzinfo=UTC)
763
+ self._sun_observer_nautical.next_rising(ephem.Sun(), use_center=True)
764
+ .datetime()
765
+ .replace(tzinfo=UTC)
739
766
  )
740
767
  except (ephem.AlwaysUpError, ephem.NeverUpError):
741
768
  # Search for the next astronomical rising
@@ -747,7 +774,9 @@ class AstronomicalRoutines:
747
774
  self._sun_observer_nautical.date = timestamp
748
775
  try:
749
776
  self._sun_data["next_rising_nautical"] = (
750
- self._sun_observer_nautical.next_rising(ephem.Sun(), use_center=True)
777
+ self._sun_observer_nautical.next_rising(
778
+ ephem.Sun(), use_center=True
779
+ )
751
780
  .datetime()
752
781
  .replace(tzinfo=UTC)
753
782
  )
@@ -757,7 +786,9 @@ class AstronomicalRoutines:
757
786
 
758
787
  try:
759
788
  self._sun_data["next_setting_nautical"] = (
760
- self._sun_observer_nautical.next_setting(ephem.Sun(), use_center=True).datetime().replace(tzinfo=UTC)
789
+ self._sun_observer_nautical.next_setting(ephem.Sun(), use_center=True)
790
+ .datetime()
791
+ .replace(tzinfo=UTC)
761
792
  )
762
793
  except (ephem.AlwaysUpError, ephem.NeverUpError):
763
794
  # Search for the next astronomical setting
@@ -769,7 +800,9 @@ class AstronomicalRoutines:
769
800
  self._sun_observer_nautical.date = timestamp
770
801
  try:
771
802
  self._sun_data["next_setting_nautical"] = (
772
- self._sun_observer_nautical.next_setting(ephem.Sun(), use_center=True)
803
+ self._sun_observer_nautical.next_setting(
804
+ ephem.Sun(), use_center=True
805
+ )
773
806
  .datetime()
774
807
  .replace(tzinfo=UTC)
775
808
  )
@@ -784,7 +817,9 @@ class AstronomicalRoutines:
784
817
 
785
818
  try:
786
819
  self._sun_data["next_rising_astro"] = (
787
- self._sun_observer_astro.next_rising(ephem.Sun(), use_center=True).datetime().replace(tzinfo=UTC)
820
+ self._sun_observer_astro.next_rising(ephem.Sun(), use_center=True)
821
+ .datetime()
822
+ .replace(tzinfo=UTC)
788
823
  )
789
824
  except (ephem.AlwaysUpError, ephem.NeverUpError):
790
825
  # Search for the next astronomical rising
@@ -796,7 +831,9 @@ class AstronomicalRoutines:
796
831
  self._sun_observer_astro.date = timestamp
797
832
  try:
798
833
  self._sun_data["next_rising_astro"] = (
799
- self._sun_observer_astro.next_rising(ephem.Sun(), use_center=True)
834
+ self._sun_observer_astro.next_rising(
835
+ ephem.Sun(), use_center=True
836
+ )
800
837
  .datetime()
801
838
  .replace(tzinfo=UTC)
802
839
  )
@@ -806,7 +843,9 @@ class AstronomicalRoutines:
806
843
 
807
844
  try:
808
845
  self._sun_data["previous_rising_astro"] = (
809
- self._sun_observer_astro.previous_rising(ephem.Sun(), use_center=True).datetime().replace(tzinfo=UTC)
846
+ self._sun_observer_astro.previous_rising(ephem.Sun(), use_center=True)
847
+ .datetime()
848
+ .replace(tzinfo=UTC)
810
849
  )
811
850
  except (ephem.AlwaysUpError, ephem.NeverUpError):
812
851
  # Search for the previous astronomical rising
@@ -818,7 +857,9 @@ class AstronomicalRoutines:
818
857
  self._sun_observer_astro.date = timestamp
819
858
  try:
820
859
  self._sun_data["previous_rising_astro"] = (
821
- self._sun_observer_astro.previous_rising(ephem.Sun(), use_center=True)
860
+ self._sun_observer_astro.previous_rising(
861
+ ephem.Sun(), use_center=True
862
+ )
822
863
  .datetime()
823
864
  .replace(tzinfo=UTC)
824
865
  )
@@ -828,7 +869,9 @@ class AstronomicalRoutines:
828
869
 
829
870
  try:
830
871
  self._sun_data["next_setting_astro"] = (
831
- self._sun_observer_astro.next_setting(ephem.Sun(), use_center=True).datetime().replace(tzinfo=UTC)
872
+ self._sun_observer_astro.next_setting(ephem.Sun(), use_center=True)
873
+ .datetime()
874
+ .replace(tzinfo=UTC)
832
875
  )
833
876
  except (ephem.AlwaysUpError, ephem.NeverUpError):
834
877
  # Search for the next astronomical setting
@@ -840,7 +883,9 @@ class AstronomicalRoutines:
840
883
  self._sun_observer_astro.date = timestamp
841
884
  try:
842
885
  self._sun_data["next_setting_astro"] = (
843
- self._sun_observer_astro.next_setting(ephem.Sun(), use_center=True)
886
+ self._sun_observer_astro.next_setting(
887
+ ephem.Sun(), use_center=True
888
+ )
844
889
  .datetime()
845
890
  .replace(tzinfo=UTC)
846
891
  )
@@ -850,7 +895,9 @@ class AstronomicalRoutines:
850
895
 
851
896
  try:
852
897
  self._sun_data["previous_setting_astro"] = (
853
- self._sun_observer_astro.previous_setting(ephem.Sun(), use_center=True).datetime().replace(tzinfo=UTC)
898
+ self._sun_observer_astro.previous_setting(ephem.Sun(), use_center=True)
899
+ .datetime()
900
+ .replace(tzinfo=UTC)
854
901
  )
855
902
  except (ephem.AlwaysUpError, ephem.NeverUpError):
856
903
  # Search for the previous astronomical setting
@@ -862,7 +909,9 @@ class AstronomicalRoutines:
862
909
  self._sun_observer_astro.date = timestamp
863
910
  try:
864
911
  self._sun_data["previous_setting_astro"] = (
865
- self._sun_observer_astro.previous_setting(ephem.Sun(), use_center=True)
912
+ self._sun_observer_astro.previous_setting(
913
+ ephem.Sun(), use_center=True
914
+ )
866
915
  .datetime()
867
916
  .replace(tzinfo=UTC)
868
917
  )
@@ -916,28 +965,36 @@ class AstronomicalRoutines:
916
965
 
917
966
  try:
918
967
  self._moon_data["next_rising"] = (
919
- self._moon_observer.next_rising(ephem.Moon()).datetime().replace(tzinfo=UTC)
968
+ self._moon_observer.next_rising(ephem.Moon())
969
+ .datetime()
970
+ .replace(tzinfo=UTC)
920
971
  )
921
972
  except (ephem.AlwaysUpError, ephem.NeverUpError):
922
973
  pass
923
974
 
924
975
  try:
925
976
  self._moon_data["next_setting"] = (
926
- self._moon_observer.next_setting(ephem.Moon()).datetime().replace(tzinfo=UTC)
977
+ self._moon_observer.next_setting(ephem.Moon())
978
+ .datetime()
979
+ .replace(tzinfo=UTC)
927
980
  )
928
981
  except (ephem.AlwaysUpError, ephem.NeverUpError):
929
982
  pass
930
983
 
931
984
  try:
932
985
  self._moon_data["previous_rising"] = (
933
- self._moon_observer.previous_rising(ephem.Moon()).datetime().replace(tzinfo=UTC)
986
+ self._moon_observer.previous_rising(ephem.Moon())
987
+ .datetime()
988
+ .replace(tzinfo=UTC)
934
989
  )
935
990
  except (ephem.AlwaysUpError, ephem.NeverUpError):
936
991
  pass
937
992
 
938
993
  try:
939
994
  self._moon_data["previous_setting"] = (
940
- self._moon_observer.previous_setting(ephem.Moon()).datetime().replace(tzinfo=UTC)
995
+ self._moon_observer.previous_setting(ephem.Moon())
996
+ .datetime()
997
+ .replace(tzinfo=UTC)
941
998
  )
942
999
  except (ephem.AlwaysUpError, ephem.NeverUpError):
943
1000
  pass
@@ -956,10 +1013,14 @@ class AstronomicalRoutines:
956
1013
  # pass
957
1014
 
958
1015
  # Next new Moon
959
- self._moon_data["next_new_moon"] = ephem.next_new_moon(self._forecast_time).datetime().replace(tzinfo=UTC)
1016
+ self._moon_data["next_new_moon"] = (
1017
+ ephem.next_new_moon(self._forecast_time).datetime().replace(tzinfo=UTC)
1018
+ )
960
1019
 
961
1020
  # Next full Moon
962
- self._moon_data["next_full_moon"] = ephem.next_full_moon(self._forecast_time).datetime().replace(tzinfo=UTC)
1021
+ self._moon_data["next_full_moon"] = (
1022
+ ephem.next_full_moon(self._forecast_time).datetime().replace(tzinfo=UTC)
1023
+ )
963
1024
 
964
1025
  # Moon phase
965
1026
  self._moon_data["phase"] = self._moon.phase
@@ -992,43 +1053,63 @@ class AstronomicalRoutines:
992
1053
  self._moon = ephem.Moon()
993
1054
 
994
1055
  # Get the distance in Earth radii
995
- self._moon_data["distance"] = self._moon.earth_distance # in AU (Astronomical Units)
1056
+ self._moon_data["distance"] = (
1057
+ self._moon.earth_distance
1058
+ ) # in AU (Astronomical Units)
996
1059
 
997
1060
  # Convert to kilometers
998
- self._moon_data["distance_km"] = self._moon_data["distance"] * 149597870.7 # 1 AU = 149597870.7 km
1061
+ self._moon_data["distance_km"] = (
1062
+ self._moon_data["distance"] * 149597870.7
1063
+ ) # 1 AU = 149597870.7 km
999
1064
 
1000
1065
  # Get the Moon's angular size (in degrees)
1001
1066
  self._moon_data["angular_size"] = self._moon.radius * 2 * 57.29578 # 180 / pi
1002
1067
 
1003
1068
  # Average distance and angular size for comparison
1004
- self._moon_data["avg_distance_km"] = 384400 # Average distance of the Moon from Earth in km
1069
+ self._moon_data["avg_distance_km"] = (
1070
+ 384400 # Average distance of the Moon from Earth in km
1071
+ )
1005
1072
  self._moon_data["avg_angular_size"] = 0.5181 # Average angular size in degrees
1006
1073
 
1007
1074
  # Relative distance and size compared to average
1008
- self._moon_data["relative_distance"] = self._moon_data["distance_km"] / self._moon_data["avg_distance_km"]
1009
- self._moon_data["relative_size"] = self._moon_data["angular_size"] / self._moon_data["avg_angular_size"]
1075
+ self._moon_data["relative_distance"] = (
1076
+ self._moon_data["distance_km"] / self._moon_data["avg_distance_km"]
1077
+ )
1078
+ self._moon_data["relative_size"] = (
1079
+ self._moon_data["angular_size"] / self._moon_data["avg_angular_size"]
1080
+ )
1010
1081
 
1011
1082
  # #########################################################################
1012
1083
  # Darkness
1013
1084
  # #########################################################################
1014
- async def darkness_data(self) -> dict:
1085
+ async def darkness_data(self) -> DarknessData:
1015
1086
  """Returns darkness data."""
1016
1087
 
1017
- if not self._test_data(self._moon_data, ["next_setting", "next_rising", "previous_setting"]):
1018
- _LOGGER.debug("DSD: moon data missing")
1019
- return False
1020
-
1021
- if not self._test_data(
1022
- self._sun_data,
1023
- ["previous_setting_astro", "next_setting_astro", "next_rising_astro"],
1024
- ):
1025
- _LOGGER.debug("DSD: sun data missing")
1026
- return False
1027
-
1028
- self._darkness_data["deep_sky_darkness_moon_rises"] = self._deep_sky_darkness_moon_rises()
1029
- self._darkness_data["deep_sky_darkness_moon_sets"] = self._deep_sky_darkness_moon_sets()
1030
- self._darkness_data["deep_sky_darkness_moon_always_up"] = self._deep_sky_darkness_moon_always_up()
1031
- self._darkness_data["deep_sky_darkness_moon_always_down"] = self._deep_sky_darkness_moon_always_down()
1088
+ # if not self._test_data(
1089
+ # self._moon_data, ["next_setting", "next_rising", "previous_setting"]
1090
+ # ):
1091
+ # _LOGGER.debug("DSD: moon data missing")
1092
+ # return False
1093
+
1094
+ # if not self._test_data(
1095
+ # self._sun_data,
1096
+ # ["previous_setting_astro", "next_setting_astro", "next_rising_astro"],
1097
+ # ):
1098
+ # _LOGGER.debug("DSD: sun data missing")
1099
+ # return False
1100
+
1101
+ self._darkness_data["deep_sky_darkness_moon_rises"] = (
1102
+ self._deep_sky_darkness_moon_rises()
1103
+ )
1104
+ self._darkness_data["deep_sky_darkness_moon_sets"] = (
1105
+ self._deep_sky_darkness_moon_sets()
1106
+ )
1107
+ self._darkness_data["deep_sky_darkness_moon_always_up"] = (
1108
+ self._deep_sky_darkness_moon_always_up()
1109
+ )
1110
+ self._darkness_data["deep_sky_darkness_moon_always_down"] = (
1111
+ self._deep_sky_darkness_moon_always_down()
1112
+ )
1032
1113
  self._darkness_data["deep_sky_darkness"] = self._deep_sky_darkness()
1033
1114
 
1034
1115
  dd = DarknessData(data=self._darkness_data)
@@ -1061,7 +1142,7 @@ class AstronomicalRoutines:
1061
1142
  if self._astronomical_darkness():
1062
1143
  _LOGGER.debug("DSD: In astronomical darkness")
1063
1144
  if self._deep_sky_darkness_moon_rises():
1064
- dsd = self._moon_data("next_rising") - self._forecast_time
1145
+ dsd = self._moon_data["next_rising"] - self._forecast_time
1065
1146
  _LOGGER.debug(f"DSD: Sun down, Moon rises {dsd}")
1066
1147
 
1067
1148
  if self._deep_sky_darkness_moon_sets():
@@ -1069,7 +1150,10 @@ class AstronomicalRoutines:
1069
1150
  dsd = self._sun_data["next_rising_astro"] - self._forecast_time
1070
1151
  _LOGGER.debug(f"DSD: Sun down, Moon is down {dsd}")
1071
1152
  else:
1072
- dsd = self._sun_data["next_rising_astro"] - self._moon_data["next_setting"]
1153
+ dsd = (
1154
+ self._sun_data["next_rising_astro"]
1155
+ - self._moon_data["next_setting"]
1156
+ )
1073
1157
  _LOGGER.debug(f"DSD: Sun down, Moon sets {dsd}")
1074
1158
 
1075
1159
  if self._deep_sky_darkness_moon_always_down():
@@ -1081,15 +1165,24 @@ class AstronomicalRoutines:
1081
1165
  if not self._astronomical_darkness():
1082
1166
  _LOGGER.debug("DSD: At sunlight")
1083
1167
  if self._deep_sky_darkness_moon_rises():
1084
- dsd = self._moon_data["next_rising"] - self._sun_data["next_setting_astro"]
1168
+ dsd = (
1169
+ self._moon_data["next_rising"]
1170
+ - self._sun_data["next_setting_astro"]
1171
+ )
1085
1172
  _LOGGER.debug(f"DSD: Sun up, Moon rises {dsd}")
1086
1173
 
1087
1174
  if self._deep_sky_darkness_moon_sets():
1088
- dsd = self._sun_data["next_rising_astro"] - self._moon_data["next_setting"]
1175
+ dsd = (
1176
+ self._sun_data["next_rising_astro"]
1177
+ - self._moon_data["next_setting"]
1178
+ )
1089
1179
  _LOGGER.debug(f"DSD: Sun up, Moon sets {dsd}")
1090
1180
 
1091
1181
  if self._deep_sky_darkness_moon_always_down():
1092
- dsd = self._sun_data["next_rising_astro"] - self._sun_data["next_setting_astro"]
1182
+ dsd = (
1183
+ self._sun_data["next_rising_astro"]
1184
+ - self._sun_data["next_setting_astro"]
1185
+ )
1093
1186
  _LOGGER.debug(f"DSD: Sun up, Moon down {dsd}")
1094
1187
 
1095
1188
  if self._deep_sky_darkness_moon_always_up():
@@ -1150,7 +1243,10 @@ class AstronomicalRoutines:
1150
1243
  else:
1151
1244
  start_timestamp_moon = self._moon_data["next_setting"]
1152
1245
 
1153
- if start_timestamp_moon > start_timestamp and start_timestamp_moon < self._sun_data["next_rising_astro"]:
1246
+ if (
1247
+ start_timestamp_moon > start_timestamp
1248
+ and start_timestamp_moon < self._sun_data["next_rising_astro"]
1249
+ ):
1154
1250
  _LOGGER.debug("DSD: Moon sets during astronomical night")
1155
1251
  return True
1156
1252
  return False
@@ -122,7 +122,7 @@ class TimeDataModel(BaseModel):
122
122
 
123
123
  class LocationDataModel(BaseModel):
124
124
  """Model for location conditions data"""
125
-
125
+
126
126
  model_config = ConfigDict(from_attributes=True)
127
127
 
128
128
  time_data: TimeDataModel
@@ -142,7 +142,7 @@ class LocationDataModel(BaseModel):
142
142
 
143
143
  class ForecastDataModel(BaseModel):
144
144
  """Model for forecast data"""
145
-
145
+
146
146
  model_config = ConfigDict(from_attributes=True)
147
147
 
148
148
  time_data: TimeDataModel
@@ -152,7 +152,7 @@ class ForecastDataModel(BaseModel):
152
152
 
153
153
  class NightlyConditionsDataModel(BaseModel):
154
154
  """Model for nightly conditions data"""
155
-
155
+
156
156
  model_config = ConfigDict(from_attributes=True)
157
157
 
158
158
  seventimer_init: datetime
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyastroweatherio
3
- Version: 0.62.0.dev6
3
+ Version: 0.62.0.dev7
4
4
  Summary: Python Wrapper for 7Timer and Met.no REST API
5
5
  Home-page: https://github.com/mawinkler/pyastroweatherio
6
6
  Author: Markus Winkler
@@ -3,7 +3,7 @@ from setuptools import setup
3
3
  setup(
4
4
  name="pyastroweatherio",
5
5
  packages=["pyastroweatherio"],
6
- version="0.62.0.dev6",
6
+ version="0.62.0.dev7",
7
7
  license="MIT",
8
8
  description="Python Wrapper for 7Timer and Met.no REST API",
9
9
  long_description=" ".join(