Skip to content

Commit

Permalink
add LL status
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveicedgreentea committed Dec 18, 2022
1 parent 0de2eca commit a4175a0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.PHONY: test dev_install build upload

dev_install:
python3 -m venv .venv
. .venv/bin/activate && \
pip3 install -r requirements-test.txt
test:
python -m unittest discover -s tests
Expand Down
6 changes: 6 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# 3.0.0

## BREAKING CHANGES

### Commands
`input` renamed to `input_mode`
19 changes: 10 additions & 9 deletions jvc_projector/jvc_projector.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import logging
from typing import Final, Union
import asyncio
from jvc_projector.commands import ACKs, Footer, Header, Commands, PowerStates, Enum
from jvc_projector.commands import ACKs, Footer, Header, Commands, PowerStates, Enum, LowLatencyModes


class JVCProjector:
Expand Down Expand Up @@ -419,16 +419,11 @@ async def async_get_low_latency_state(self) -> bool:
None if there was an error
"""
state, success = await self._async_do_reference_op(
state, _ = await self._async_do_reference_op(
"low_latency", ACKs.picture_ack
)
# LL is off, could be disabled
if not success:
return None
if state == b"PM0":
return False

return True
return LowLatencyModes(state.replace(ACKs.picture_ack.value, b"")).name

# async def _async_check_low_latency(self) -> list[str]:
# """
Expand Down Expand Up @@ -511,8 +506,14 @@ async def async_is_on(self) -> bool:
"""
True if the current state is on|reserved
"""
pw_status = [PowerStates.on.name, PowerStates.reserved.name]
pw_status = [PowerStates.on.name]
return await self._async_get_power_state() in pw_status

async def async_is_ll_on(self) -> bool:
"""
True if LL mode is on
"""
return await self.async_get_low_latency_state() == LowLatencyModes.on.name

def print_commands(self) -> str:
"""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="jvc_projector_remote_improved2",
version="2.4.5",
version="3.0.0",
author="iloveicedgreentea",
description="A package to control JVC projectors over IP",
long_description=long_description,
Expand Down

0 comments on commit a4175a0

Please sign in to comment.