Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
47e76fc
Expose current direction properly on state machine (#26298)
balloob Sep 2, 2019
732855e
bump tuyaha 0.0.4 (#26303)
PaulAnnekov Aug 31, 2019
795d540
Fix Alexa Report State (#26305)
balloob Aug 31, 2019
309d401
Fix alexa bad temp sensors (#26307)
balloob Aug 31, 2019
d1e3fbd
deCONZ - Dont update entry if data is equal
Kane610 Aug 31, 2019
85a1726
Fix google_maps scan interval (#26328)
tyjtyj Sep 1, 2019
f6cf4c3
Bumped version to 0.98.2
balloob Sep 2, 2019
8ae5ece
Merge pull request #26345 from home-assistant/rc
balloob Sep 2, 2019
b50ac6f
Upgrade pyhaversion to 3.1.0 (#26232)
fabaff Sep 3, 2019
a74bb3f
String has nothing to do with class method naming (#26368)
Kane610 Sep 3, 2019
a980eed
Fix race during initial Sonos group construction (#26371)
amelchio Sep 3, 2019
d490547
Allow core config updated (#26398)
balloob Sep 4, 2019
93e4cd6
Met, check for existing location (#26400)
Danielhiversen Sep 4, 2019
8cf02e0
Update to 0.1.13 (#26402)
ehendrix23 Sep 4, 2019
7bccbcb
Fix state report (#26406)
balloob Sep 4, 2019
860843a
Bump ISY994's PyISY dependency to 1.1.2 (#26413)
OverloadUT Sep 4, 2019
b8f9319
Bumped version to 0.98.3
balloob Sep 4, 2019
e59eea3
Merge pull request #26414 from home-assistant/rc
pvizeli Sep 4, 2019
c922448
Add config flow to transmission
engrbm87 Sep 4, 2019
1d201ef
sort imports and constants
engrbm87 Sep 4, 2019
2c65e02
Updated frontend to 20190904.0 (#26421)
bramkragten Sep 4, 2019
c4c21d3
Add device to mqtt camera (#26238)
zewelor Sep 4, 2019
fba0604
Merge remote-tracking branch 'origin/master' into dev
balloob Sep 4, 2019
4004879
Entity registry doesn't overwrite with None (#24275)
Swamp-Ig Sep 4, 2019
0df1b4c
Replaces IOError by OSError (#26428)
frenck Sep 4, 2019
3313a6c
Add config flow to transmission
engrbm87 Sep 4, 2019
2105ec1
sort imports and constants
engrbm87 Sep 4, 2019
60e0a99
Merge branch 'transmission' of https://github.com/engrbm87/home-assis…
engrbm87 Sep 4, 2019
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
6 changes: 3 additions & 3 deletions homeassistant/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def check_pid(pid_file: str) -> None:
try:
with open(pid_file, "r") as file:
pid = int(file.readline())
except IOError:
except OSError:
# PID File does not exist
return

Expand All @@ -239,7 +239,7 @@ def write_pid(pid_file: str) -> None:
try:
with open(pid_file, "w") as file:
file.write(str(pid))
except IOError:
except OSError:
print(f"Fatal Error: Unable to write pid file {pid_file}")
sys.exit(1)

Expand All @@ -258,7 +258,7 @@ def closefds_osx(min_fd: int, max_fd: int) -> None:
val = fcntl(_fd, F_GETFD)
if not val & FD_CLOEXEC:
fcntl(_fd, F_SETFD, val | FD_CLOEXEC)
except IOError:
except OSError:
pass


Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/bme680/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def _setup_bme680(config):
sensor.select_gas_heater_profile(0)
else:
sensor.set_gas_status(bme680.DISABLE_GAS_MEAS)
except (RuntimeError, IOError):
except (RuntimeError, OSError):
_LOGGER.error("BME680 sensor not detected at 0x%02x", i2c_address)
return None

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/bmw_connected_drive/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def update(self, *_):
self.account.update_vehicle_states()
for listener in self._update_listeners:
listener()
except IOError as exception:
except OSError as exception:
_LOGGER.error(
"Could not connect to the BMW Connected Drive portal. "
"The vehicle state could not be updated."
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/deconz/.translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"options": {
"step": {
"async_step_deconz_devices": {
"deconz_devices": {
"data": {
"allow_clip_sensor": "Allow deCONZ CLIP sensors",
"allow_deconz_groups": "Allow deCONZ light groups"
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/egardia/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def setup(hass, config):
server = egardiaserver.EgardiaServer("", rs_port)
bound = server.bind()
if not bound:
raise IOError(
raise OSError(
"Binding error occurred while " + "starting EgardiaServer."
)
hass.data[EGARDIA_SERVER] = server
Expand All @@ -123,7 +123,7 @@ def handle_stop_event(event):
# listen to home assistant stop event
hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, handle_stop_event)

except IOError:
except OSError:
_LOGGER.error("Binding error occurred while starting EgardiaServer")
return False

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/frontend/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Home Assistant Frontend",
"documentation": "https://www.home-assistant.io/components/frontend",
"requirements": [
"home-assistant-frontend==20190901.0"
"home-assistant-frontend==20190904.0"
],
"dependencies": [
"api",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/hangouts/hangouts_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ async def _async_send_message(self, message, targets, data):
if self.hass.config.is_allowed_path(uri):
try:
image_file = open(uri, "rb")
except IOError as error:
except OSError as error:
_LOGGER.error(
"Image file I/O error(%s): %s", error.errno, error.strerror
)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/keyboard_remote/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def run(self):

try:
event = self.dev.read_one()
except IOError: # Keyboard Disconnected
except OSError: # Keyboard Disconnected
self.dev = None
self.hass.bus.fire(
KEYBOARD_REMOTE_DISCONNECTED,
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/liveboxplaytv/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
try:
device = LiveboxPlayTvDevice(host, port, name)
livebox_devices.append(device)
except IOError:
except OSError:
_LOGGER.error(
"Failed to connect to Livebox Play TV at %s:%s. "
"Please check your configuration",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/miflora/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def update(self):
try:
_LOGGER.debug("Polling data for %s", self.name)
data = self.poller.parameter_value(self.parameter)
except IOError as ioerr:
except OSError as ioerr:
_LOGGER.info("Polling error %s", ioerr)
return
except BluetoothBackendException as bterror:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/mitemp_bt/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def update(self):
try:
_LOGGER.debug("Polling data for %s", self.name)
data = self.poller.parameter_value(self.parameter)
except IOError as ioerr:
except OSError as ioerr:
_LOGGER.warning("Polling error %s", ioerr)
return
except BluetoothBackendException as bterror:
Expand Down
29 changes: 22 additions & 7 deletions homeassistant/components/mqtt/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@

from homeassistant.components import camera, mqtt
from homeassistant.components.camera import PLATFORM_SCHEMA, Camera
from homeassistant.const import CONF_NAME
from homeassistant.const import CONF_NAME, CONF_DEVICE
from homeassistant.core import callback
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.typing import ConfigType, HomeAssistantType

from . import ATTR_DISCOVERY_HASH, CONF_UNIQUE_ID, MqttDiscoveryUpdate, subscription
from . import (
ATTR_DISCOVERY_HASH,
CONF_UNIQUE_ID,
MqttDiscoveryUpdate,
MqttEntityDeviceInfo,
subscription,
)
from .discovery import MQTT_DISCOVERY_NEW, clear_discovery_hash

_LOGGER = logging.getLogger(__name__)
Expand All @@ -26,6 +32,7 @@
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Required(CONF_TOPIC): mqtt.valid_subscribe_topic,
vol.Optional(CONF_UNIQUE_ID): cv.string,
vol.Optional(CONF_DEVICE): mqtt.MQTT_ENTITY_DEVICE_INFO_SCHEMA,
}
)

Expand All @@ -45,7 +52,9 @@ async def async_discover(discovery_payload):
try:
discovery_hash = discovery_payload.pop(ATTR_DISCOVERY_HASH)
config = PLATFORM_SCHEMA(discovery_payload)
await _async_setup_entity(config, async_add_entities, discovery_hash)
await _async_setup_entity(
config, async_add_entities, config_entry, discovery_hash
)
except Exception:
if discovery_hash:
clear_discovery_hash(hass, discovery_hash)
Expand All @@ -56,15 +65,17 @@ async def async_discover(discovery_payload):
)


async def _async_setup_entity(config, async_add_entities, discovery_hash=None):
async def _async_setup_entity(
config, async_add_entities, config_entry=None, discovery_hash=None
):
"""Set up the MQTT Camera."""
async_add_entities([MqttCamera(config, discovery_hash)])
async_add_entities([MqttCamera(config, config_entry, discovery_hash)])


class MqttCamera(MqttDiscoveryUpdate, Camera):
class MqttCamera(MqttDiscoveryUpdate, MqttEntityDeviceInfo, Camera):
"""representation of a MQTT camera."""

def __init__(self, config, discovery_hash):
def __init__(self, config, config_entry, discovery_hash):
"""Initialize the MQTT Camera."""
self._config = config
self._unique_id = config.get(CONF_UNIQUE_ID)
Expand All @@ -73,8 +84,11 @@ def __init__(self, config, discovery_hash):
self._qos = 0
self._last_image = None

device_config = config.get(CONF_DEVICE)

Camera.__init__(self)
MqttDiscoveryUpdate.__init__(self, discovery_hash, self.discovery_update)
MqttEntityDeviceInfo.__init__(self, device_config, config_entry)

async def async_added_to_hass(self):
"""Subscribe MQTT events."""
Expand All @@ -85,6 +99,7 @@ async def discovery_update(self, discovery_payload):
"""Handle updated discovery message."""
config = PLATFORM_SCHEMA(discovery_payload)
self._config = config
await self.device_info_discovery_update(config)
await self._subscribe_topics()
self.async_write_ha_state()

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/pilight/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def send_code(call):

try:
pilight_client.send_code(message_data)
except IOError:
except OSError:
_LOGGER.error("Pilight send failed for %s", str(message_data))

hass.services.register(DOMAIN, SERVICE_NAME, send_code, schema=RF_CODE_SCHEMA)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/proxy/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _precheck_image(image, opts):
raise ValueError()
try:
img = Image.open(io.BytesIO(image))
except IOError:
except OSError:
_LOGGER.warning("Failed to open image")
raise ValueError()
imgfmt = str(img.format)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/remote_rpi_gpio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def setup_input(address, port, pull_mode, bouncetime):
bounce_time=bouncetime,
pin_factory=PiGPIOFactory(address),
)
except (ValueError, IndexError, KeyError, IOError):
except (ValueError, IndexError, KeyError, OSError):
return None


Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/remote_rpi_gpio/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
button = remote_rpi_gpio.setup_input(
address, port_num, pull_mode, bouncetime
)
except (ValueError, IndexError, KeyError, IOError):
except (ValueError, IndexError, KeyError, OSError):
return
new_sensor = RemoteRPiGPIOBinarySensor(port_name, button, invert_logic)
devices.append(new_sensor)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/remote_rpi_gpio/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
for port, name in ports.items():
try:
led = remote_rpi_gpio.setup_output(address, port, invert_logic)
except (ValueError, IndexError, KeyError, IOError):
except (ValueError, IndexError, KeyError, OSError):
return
new_switch = RemoteRPiGPIOSwitch(name, led, invert_logic)
devices.append(new_switch)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/sky_hub/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def _parse_skyhub_response(data_str):
"""Parse the Sky Hub data format."""
pattmatch = re.search("attach_dev = '(.*)'", data_str)
if pattmatch is None:
raise IOError(
raise OSError(
"Error: Impossible to fetch data from"
+ " Sky Hub. Try to reboot the router."
)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/supla/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def setup(hass, base_config):
srv_info,
)
return False
except IOError:
except OSError:
_LOGGER.exception(
"Server: %s not configured. Error on Supla API access: ", server_address
)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/telnet/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def _telnet_command(self, command):
response = telnet.read_until(b"\r", timeout=self._timeout)
_LOGGER.debug("telnet response: %s", response.decode("ASCII").strip())
return response.decode("ASCII").strip()
except IOError as error:
except OSError as error:
_LOGGER.error(
'Command "%s" failed with exception: %s', command, repr(error)
)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/temper/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def update(self):
)
sensor_value = self.temper_device.get_temperature(format_str)
self.current_value = round(sensor_value, 1)
except IOError:
except OSError:
_LOGGER.error(
"Failed to get temperature. The device address may"
"have changed. Attempting to reset device"
Expand Down
57 changes: 57 additions & 0 deletions homeassistant/components/transmission/.translations/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"config": {
"title": "Transmission",
"step": {
"user": {
"title": "Set up Transmission Client",
"data": {
"name": "Name",
"host": "Host",
"username": "User name",
"password": "Password",
"port": "Port"
}
},
"options": {
"title": "Configure Options",
"data": {
"active_torrents": "Active Torrents",
"current_status": "Current Status",
"download_speed": "Download Speed [MB/s]",
"paused_torrents": "Pause Torrents",
"total_torrents": "Total Torrents",
"upload_speed": "Upload Speed [MB/s]",
"completed_torrents": "Completed torrents (seeding)",
"started_torrents": "Started torrents (downloading)",
"turtle_mode": "‘Turtle mode’ switch",
"scan_interval": "Update frequency"
}
}
},
"error": {
"cannot_connect": "Unable to Connect to Client"
},
"abort": {
"one_instance_allowed": "Only a single instance is necessary."
}
},
"options": {
"step": {
"init": {
"description": "Configure options for Transmission",
"data": {
"active_torrents": "Active Torrents",
"current_status": "Current Status",
"download_speed": "Download Speed [MB/s]",
"paused_torrents": "Pause Torrents",
"total_torrents": "Total Torrents",
"upload_speed": "Upload Speed [MB/s]",
"completed_torrents": "Completed torrents (seeding)",
"started_torrents": "Started torrents (downloading)",
"turtle_mode": "‘Turtle mode’ switch",
"scan_interval": "Update frequency"
}
}
}
}
}
Loading