Move imports to top for random (#29473)
This commit is contained in:
parent
d9661b408b
commit
c02d551cd5
2 changed files with 6 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue