Move imports to top for random (#29473)

This commit is contained in:
springstan 2019-12-05 06:13:05 +01:00 committed by Paulus Schoutsen
parent d9661b408b
commit c02d551cd5
2 changed files with 6 additions and 6 deletions

View file

@ -1,5 +1,6 @@
"""Support for showing random numbers."""
import logging
from random import randrange
import voluptuous as vol
@ -82,6 +83,5 @@ class RandomSensor(Entity):
async def async_update(self):
"""Get a new number and updates the states."""
from random import randrange
self._state = randrange(self._minimum, self._maximum + 1)