mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +00:00
Disable invalid-sequence-index (#7177)
This commit is contained in:
parent
a41d0aced7
commit
8ba41563c9
@ -14,6 +14,7 @@ if False:
|
|||||||
ConfigType = Dict[str, Any]
|
ConfigType = Dict[str, Any]
|
||||||
|
|
||||||
|
|
||||||
|
# pylint: disable=invalid-sequence-index
|
||||||
def config_per_platform(config: ConfigType,
|
def config_per_platform(config: ConfigType,
|
||||||
domain: str) -> Iterable[Tuple[Any, Any]]:
|
domain: str) -> Iterable[Tuple[Any, Any]]:
|
||||||
"""Generator to break a component config into different platforms.
|
"""Generator to break a component config into different platforms.
|
||||||
|
@ -183,7 +183,7 @@ def color_name_to_rgb(color_name):
|
|||||||
# Taken from:
|
# Taken from:
|
||||||
# http://www.developers.meethue.com/documentation/color-conversions-rgb-xy
|
# http://www.developers.meethue.com/documentation/color-conversions-rgb-xy
|
||||||
# License: Code is given as is. Use at your own risk and discretion.
|
# License: Code is given as is. Use at your own risk and discretion.
|
||||||
# pylint: disable=invalid-name
|
# pylint: disable=invalid-name, invalid-sequence-index
|
||||||
def color_RGB_to_xy(iR: int, iG: int, iB: int) -> Tuple[float, float, int]:
|
def color_RGB_to_xy(iR: int, iG: int, iB: int) -> Tuple[float, float, int]:
|
||||||
"""Convert from RGB color to XY color."""
|
"""Convert from RGB color to XY color."""
|
||||||
if iR + iG + iB == 0:
|
if iR + iG + iB == 0:
|
||||||
@ -219,6 +219,7 @@ def color_RGB_to_xy(iR: int, iG: int, iB: int) -> Tuple[float, float, int]:
|
|||||||
|
|
||||||
# Converted to Python from Obj-C, original source from:
|
# Converted to Python from Obj-C, original source from:
|
||||||
# http://www.developers.meethue.com/documentation/color-conversions-rgb-xy
|
# http://www.developers.meethue.com/documentation/color-conversions-rgb-xy
|
||||||
|
# pylint: disable=invalid-sequence-index
|
||||||
def color_xy_brightness_to_RGB(vX: float, vY: float,
|
def color_xy_brightness_to_RGB(vX: float, vY: float,
|
||||||
ibrightness: int) -> Tuple[int, int, int]:
|
ibrightness: int) -> Tuple[int, int, int]:
|
||||||
"""Convert from XYZ to RGB."""
|
"""Convert from XYZ to RGB."""
|
||||||
@ -259,18 +260,21 @@ def color_xy_brightness_to_RGB(vX: float, vY: float,
|
|||||||
return (ir, ig, ib)
|
return (ir, ig, ib)
|
||||||
|
|
||||||
|
|
||||||
|
# pylint: disable=invalid-sequence-index
|
||||||
def color_RGB_to_hsv(iR: int, iG: int, iB: int) -> Tuple[int, int, int]:
|
def color_RGB_to_hsv(iR: int, iG: int, iB: int) -> Tuple[int, int, int]:
|
||||||
"""Convert an rgb color to its hsv representation."""
|
"""Convert an rgb color to its hsv representation."""
|
||||||
fHSV = colorsys.rgb_to_hsv(iR/255.0, iG/255.0, iB/255.0)
|
fHSV = colorsys.rgb_to_hsv(iR/255.0, iG/255.0, iB/255.0)
|
||||||
return (int(fHSV[0]*65536), int(fHSV[1]*255), int(fHSV[2]*255))
|
return (int(fHSV[0]*65536), int(fHSV[1]*255), int(fHSV[2]*255))
|
||||||
|
|
||||||
|
|
||||||
|
# pylint: disable=invalid-sequence-index
|
||||||
def color_xy_brightness_to_hsv(vX: float, vY: float,
|
def color_xy_brightness_to_hsv(vX: float, vY: float,
|
||||||
ibrightness: int) -> Tuple[int, int, int]:
|
ibrightness: int) -> Tuple[int, int, int]:
|
||||||
"""Convert an xy brightness color to its hsv representation."""
|
"""Convert an xy brightness color to its hsv representation."""
|
||||||
return color_RGB_to_hsv(*color_xy_brightness_to_RGB(vX, vY, ibrightness))
|
return color_RGB_to_hsv(*color_xy_brightness_to_RGB(vX, vY, ibrightness))
|
||||||
|
|
||||||
|
|
||||||
|
# pylint: disable=invalid-sequence-index
|
||||||
def _match_max_scale(input_colors: Tuple[int, ...],
|
def _match_max_scale(input_colors: Tuple[int, ...],
|
||||||
output_colors: Tuple[int, ...]) -> Tuple[int, ...]:
|
output_colors: Tuple[int, ...]) -> Tuple[int, ...]:
|
||||||
"""Match the maximum value of the output to the input."""
|
"""Match the maximum value of the output to the input."""
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""Provides helper methods to handle the time in HA."""
|
"""Helper methods to handle the time in Home Assistant."""
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@ -184,6 +184,7 @@ def get_age(date: dt.datetime) -> str:
|
|||||||
elif number > 1:
|
elif number > 1:
|
||||||
return "%d %ss" % (number, unit)
|
return "%d %ss" % (number, unit)
|
||||||
|
|
||||||
|
# pylint: disable=invalid-sequence-index
|
||||||
def q_n_r(first: int, second: int) -> Tuple[int, int]:
|
def q_n_r(first: int, second: int) -> Tuple[int, int]:
|
||||||
"""Return quotient and remaining."""
|
"""Return quotient and remaining."""
|
||||||
return first // second, first % second
|
return first // second, first % second
|
||||||
|
@ -9,7 +9,6 @@ from typing import Any, Optional, Tuple, Dict
|
|||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
|
||||||
ELEVATION_URL = 'http://maps.googleapis.com/maps/api/elevation/json'
|
ELEVATION_URL = 'http://maps.googleapis.com/maps/api/elevation/json'
|
||||||
FREEGEO_API = 'https://freegeoip.io/json/'
|
FREEGEO_API = 'https://freegeoip.io/json/'
|
||||||
IP_API = 'http://ip-api.com/json'
|
IP_API = 'http://ip-api.com/json'
|
||||||
@ -83,7 +82,7 @@ def elevation(latitude, longitude):
|
|||||||
# Author: https://github.com/maurycyp
|
# Author: https://github.com/maurycyp
|
||||||
# Source: https://github.com/maurycyp/vincenty
|
# Source: https://github.com/maurycyp/vincenty
|
||||||
# License: https://github.com/maurycyp/vincenty/blob/master/LICENSE
|
# License: https://github.com/maurycyp/vincenty/blob/master/LICENSE
|
||||||
# pylint: disable=invalid-name, unused-variable
|
# pylint: disable=invalid-name, unused-variable, invalid-sequence-index
|
||||||
def vincenty(point1: Tuple[float, float], point2: Tuple[float, float],
|
def vincenty(point1: Tuple[float, float], point2: Tuple[float, float],
|
||||||
miles: bool=False) -> Optional[float]:
|
miles: bool=False) -> Optional[float]:
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user