diff --git a/homeassistant/components/amcrest/manifest.json b/homeassistant/components/amcrest/manifest.json index e05fdcf4bd4..a2eb8c24e21 100644 --- a/homeassistant/components/amcrest/manifest.json +++ b/homeassistant/components/amcrest/manifest.json @@ -3,7 +3,7 @@ "name": "Amcrest", "documentation": "https://www.home-assistant.io/components/amcrest", "requirements": [ - "amcrest==1.3.0" + "amcrest==1.4.0" ], "dependencies": [ "ffmpeg" diff --git a/homeassistant/components/amcrest/sensor.py b/homeassistant/components/amcrest/sensor.py index 4d2cd88c5ae..718d08358c4 100644 --- a/homeassistant/components/amcrest/sensor.py +++ b/homeassistant/components/amcrest/sensor.py @@ -84,8 +84,16 @@ class AmcrestSensor(Entity): self._state = self._api.ptz_presets_count elif self._sensor_type == 'sdcard': - sd_used = self._api.storage_used - sd_total = self._api.storage_total - self._attrs['Total'] = '{0} {1}'.format(*sd_total) - self._attrs['Used'] = '{0} {1}'.format(*sd_used) - self._state = self._api.storage_used_percent + storage = self._api.storage_all + try: + self._attrs['Total'] = '{:.2f} {}'.format(*storage['total']) + except ValueError: + self._attrs['Total'] = '{} {}'.format(*storage['total']) + try: + self._attrs['Used'] = '{:.2f} {}'.format(*storage['used']) + except ValueError: + self._attrs['Used'] = '{} {}'.format(*storage['used']) + try: + self._state = '{:.2f}'.format(storage['used_percent']) + except ValueError: + self._state = storage['used_percent'] diff --git a/requirements_all.txt b/requirements_all.txt index 1540a936b5b..b4a8d1bd75e 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -161,7 +161,7 @@ alarmdecoder==1.13.2 alpha_vantage==2.1.0 # homeassistant.components.amcrest -amcrest==1.3.0 +amcrest==1.4.0 # homeassistant.components.androidtv androidtv==0.0.15