Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions homeassistant/components/environment_canada/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

_LOGGER = logging.getLogger(__name__)

ATTR_STATION = "station"
ATTR_LOCATION = "location"
ATTR_UPDATED = "updated"

CONF_ATTRIBUTION = "Data provided by Environment Canada"
Expand Down Expand Up @@ -50,7 +48,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
else:
lat = config.get(CONF_LATITUDE, hass.config.latitude)
lon = config.get(CONF_LONGITUDE, hass.config.longitude)
radar_object = ECRadar(coordinates=(lat, lon))
radar_object = ECRadar(
coordinates=(lat, lon), precip_type=config.get(CONF_PRECIP_TYPE)
)

add_devices([ECCamera(radar_object, config.get(CONF_NAME))], True)

Expand Down Expand Up @@ -78,17 +78,12 @@ def name(self):
"""Return the name of the camera."""
if self.camera_name is not None:
return self.camera_name
return " ".join([self.radar_object.station_name, "Radar"])
return "Environment Canada Radar"
Comment thread
michaeldavie marked this conversation as resolved.

@property
def device_state_attributes(self):
"""Return the state attributes of the device."""
attr = {
ATTR_ATTRIBUTION: CONF_ATTRIBUTION,
ATTR_LOCATION: self.radar_object.station_name,
ATTR_STATION: self.radar_object.station_code,
ATTR_UPDATED: self.timestamp,
}
attr = {ATTR_ATTRIBUTION: CONF_ATTRIBUTION, ATTR_UPDATED: self.timestamp}
Comment thread
michaeldavie marked this conversation as resolved.

return attr

Expand All @@ -99,4 +94,4 @@ def update(self):
self.image = self.radar_object.get_loop()
else:
self.image = self.radar_object.get_latest_frame()
self.timestamp = self.radar_object.timestamp.isoformat()
self.timestamp = self.radar_object.timestamp
2 changes: 1 addition & 1 deletion homeassistant/components/environment_canada/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"domain": "environment_canada",
"name": "Environment Canada",
"documentation": "https://www.home-assistant.io/integrations/environment_canada",
"requirements": ["env_canada==0.0.35"],
"requirements": ["env_canada==0.0.38"],
"codeowners": ["@michaeldavie"]
}
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ enocean==0.50
enturclient==0.2.1

# homeassistant.components.environment_canada
env_canada==0.0.35
env_canada==0.0.38

# homeassistant.components.envirophat
# envirophat==0.0.6
Expand Down