basbruss / adaptive-cover

An Adaptive Cover component for HomeAsisstant to control covers based on the sun's position
MIT License
71 stars 10 forks source link

Outside temperature not following the description #259

Closed Appesteijn closed 1 month ago

Appesteijn commented 1 month ago

When I use a outside temperature sensor and a climate entity, I would expect the outside temperature sensor to be used for the outside temperature. This is also what the descriptions indicate 'Overrides outside temperature from weather entity if both are set'

When I look at this code:

    def outside_temperature(self):
        """Get outside temperature."""
        temp = None
        if self.outside_entity:
            temp = get_safe_state(
                self.hass,
                self.outside_entity,
            )
        if self.weather_entity:
            temp = state_attr(self.hass, self.weather_entity, "temperature")
        return temp

Shouldn't the last if be an elif?

Appesteijn commented 1 month ago

👍