mirror of
				https://github.com/Akkudoktor-EOS/EOS.git
				synced 2025-11-04 08:46:20 +00:00 
			
		
		
		
	Config: Move lat/long/timezone from prediction to general
This commit is contained in:
		@@ -34,7 +34,7 @@ class VisualizationReport(ConfigMixin):
 | 
			
		||||
        self.pdf_pages = PdfPages(filename, metadata={})  # Initialize PdfPages without metadata
 | 
			
		||||
        self.version = version  # overwrite version as test for constant output of pdf for test
 | 
			
		||||
        self.current_time = to_datetime(
 | 
			
		||||
            as_string="YYYY-MM-DD HH:mm:ss", in_timezone=self.config.prediction.timezone
 | 
			
		||||
            as_string="YYYY-MM-DD HH:mm:ss", in_timezone=self.config.general.timezone
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
    def add_chart_to_group(self, chart_func: Callable[[], None]) -> None:
 | 
			
		||||
@@ -173,7 +173,7 @@ class VisualizationReport(ConfigMixin):
 | 
			
		||||
            plt.grid(True)
 | 
			
		||||
 | 
			
		||||
            # Add vertical line for the current date if within the axis range
 | 
			
		||||
            current_time = pendulum.now(self.config.prediction.timezone)
 | 
			
		||||
            current_time = pendulum.now(self.config.general.timezone)
 | 
			
		||||
            if timestamps[0].subtract(hours=2) <= current_time <= timestamps[-1]:
 | 
			
		||||
                plt.axvline(current_time, color="r", linestyle="--", label="Now")
 | 
			
		||||
                plt.text(current_time, plt.ylim()[1], "Now", color="r", ha="center", va="bottom")
 | 
			
		||||
@@ -419,9 +419,7 @@ def prepare_visualize(
 | 
			
		||||
    start_hour: Optional[int] = 0,
 | 
			
		||||
) -> None:
 | 
			
		||||
    report = VisualizationReport(filename)
 | 
			
		||||
    next_full_hour_date = (
 | 
			
		||||
        pendulum.now(report.config.prediction.timezone).start_of("hour").add(hours=1)
 | 
			
		||||
    )
 | 
			
		||||
    next_full_hour_date = pendulum.now(report.config.general.timezone).start_of("hour").add(hours=1)
 | 
			
		||||
    # Group 1:
 | 
			
		||||
    report.create_line_chart_date(
 | 
			
		||||
        next_full_hour_date,  # start_date
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user