Module genshin.models.zzz.chronicle.notes

ZZZ sticky notes (real-time notes) models.

Classes

class BatteryCharge (**data: Any)
Expand source code
class BatteryCharge(APIModel):
    """ZZZ battery charge model."""

    current: int
    max: int
    seconds_till_full: int = Aliased("restore")

    @property
    def is_full(self) -> bool:
        """Check if the energy is full."""
        return self.current == self.max

    @property
    def full_datetime(self) -> datetime.datetime:
        """Get the datetime when the energy will be full."""
        return datetime.datetime.now().astimezone() + datetime.timedelta(seconds=self.seconds_till_full)

    @pydantic.model_validator(mode="before")
    @classmethod
    def __unnest_progress(cls, values: dict[str, typing.Any]) -> dict[str, typing.Any]:
        return {**values, **values.pop("progress", {})}

ZZZ battery charge model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var current : int
var max : int
var model_config : pydantic.config.ConfigDict
var seconds_till_full : int

Instance variables

prop full_datetime : datetime.datetime
Expand source code
@property
def full_datetime(self) -> datetime.datetime:
    """Get the datetime when the energy will be full."""
    return datetime.datetime.now().astimezone() + datetime.timedelta(seconds=self.seconds_till_full)

Get the datetime when the energy will be full.

prop is_full : bool
Expand source code
@property
def is_full(self) -> bool:
    """Check if the energy is full."""
    return self.current == self.max

Check if the energy is full.

class VideoStoreState (value, names=None, *, module=None, qualname=None, type=None, start=1)
Expand source code
class VideoStoreState(enum.Enum):
    """Video store management state."""

    REVENUE_AVAILABLE = "SaleStateDone"
    WAITING_TO_OPEN = "SaleStateNo"
    CURRENTLY_OPEN = "SaleStateDoing"

Video store management state.

Ancestors

  • enum.Enum

Class variables

var CURRENTLY_OPEN
var REVENUE_AVAILABLE
var WAITING_TO_OPEN
class ZZZEngagement (**data: Any)
Expand source code
class ZZZEngagement(APIModel):
    """ZZZ engagement model."""

    current: int
    max: int

ZZZ engagement model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var current : int
var max : int
var model_config : pydantic.config.ConfigDict
class ZZZMemberCard (**data: Any)
Expand source code
class ZZZMemberCard(APIModel):
    """ZZZ Member Card model."""

    exp_time: datetime.timedelta
    is_open: bool
    member_card_state: ZZZMemberCardState

    @property
    def reset_datetime(self) -> datetime.datetime:
        """The datetime when the member card will be reset."""
        return datetime.datetime.now().astimezone() + self.exp_time

    @pydantic.field_validator("exp_time", mode="before")
    @classmethod
    def __parse_currency_refresh(cls, v: str) -> datetime.timedelta:
        return datetime.timedelta(seconds=int(v))

ZZZ Member Card model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var exp_time : datetime.timedelta
var is_open : bool
var member_card_state : genshin.models.zzz.chronicle.notes.ZZZMemberCardState
var model_config : pydantic.config.ConfigDict

Instance variables

prop reset_datetime : datetime.datetime
Expand source code
@property
def reset_datetime(self) -> datetime.datetime:
    """The datetime when the member card will be reset."""
    return datetime.datetime.now().astimezone() + self.exp_time

The datetime when the member card will be reset.

class ZZZNotes (**data: Any)
Expand source code
class ZZZNotes(APIModel):
    """Zenless Zone Zero sticky notes model."""

    battery_charge: BatteryCharge = Aliased("energy")
    engagement: ZZZEngagement = Aliased("vitality")
    scratch_card_completed: bool = Aliased("card_sign")
    video_store_state: VideoStoreState
    hollow_zero: HollowZero
    weekly_task: typing.Optional[WeeklyTask] = None
    card_sign: ZZZCardSignState
    member_card: ZZZMemberCard
    temple_running: ZZZTempleRunning

    @pydantic.field_validator("scratch_card_completed", mode="before")
    @classmethod
    def __transform_value(cls, v: typing.Literal["CardSignDone", "CardSignNotDone"]) -> bool:
        return v == "CardSignDone"

    @pydantic.model_validator(mode="before")
    @classmethod
    def __unnest_value(cls, values: dict[str, typing.Any]) -> dict[str, typing.Any]:
        if "video_store_state" not in values:
            values["video_store_state"] = values["vhs_sale"]["sale_state"]
        if "hollow_zero" not in values:
            values["hollow_zero"] = {
                "bounty_commission": values["bounty_commission"],
                "survey_points": values["survey_points"],
            }
        return values

Zenless Zone Zero sticky notes model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var battery_charge : BatteryCharge
var card_sign : genshin.models.zzz.chronicle.notes.ZZZCardSignState
var engagement : ZZZEngagement
var hollow_zero : genshin.models.zzz.chronicle.notes.HollowZero
var member_card : ZZZMemberCard
var model_config : pydantic.config.ConfigDict
var scratch_card_completed : bool
var temple_running : ZZZTempleRunning
var video_store_state : VideoStoreState
var weekly_task : genshin.models.zzz.chronicle.notes.WeeklyTask | None
class ZZZTempleRunning (**data: Any)
Expand source code
class ZZZTempleRunning(APIModel):
    """ZZZ Suibian Temple Management model."""

    bench_state: typing.Union[BenchState, str]
    currency_next_refresh_ts: datetime.timedelta
    current_currency: int
    expedition_state: typing.Union[ExpeditionState, str]
    level: int
    shelve_state: typing.Union[ShelveStoreState, str]
    weekly_currency_max: int
    auto_work: typing.Optional[ZZZAutoWork] = None

    @property
    def reset_datetime(self) -> datetime.datetime:
        """The datetime when the currency will be reset."""
        return datetime.datetime.now().astimezone() + self.currency_next_refresh_ts

    @pydantic.field_validator("currency_next_refresh_ts", mode="before")
    @classmethod
    def __parse_currency_refresh(cls, v: str) -> datetime.timedelta:
        return datetime.timedelta(seconds=int(v))

    @pydantic.field_validator("bench_state", mode="before")
    @classmethod
    def __parse_bench_state(cls, v: str) -> typing.Union[BenchState, str]:
        return prevent_enum_error(v, BenchState)

    @pydantic.field_validator("expedition_state", mode="before")
    @classmethod
    def __parse_expedition_state(cls, v: str) -> typing.Union[ExpeditionState, str]:
        return prevent_enum_error(v, ExpeditionState)

    @pydantic.field_validator("shelve_state", mode="before")
    @classmethod
    def __parse_shelve_store_state(cls, v: str) -> typing.Union[ShelveStoreState, str]:
        return prevent_enum_error(v, ShelveStoreState)

ZZZ Suibian Temple Management model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var auto_work : genshin.models.zzz.chronicle.notes.ZZZAutoWork | None
var bench_state : genshin.models.zzz.chronicle.notes.BenchState | str
var currency_next_refresh_ts : datetime.timedelta
var current_currency : int
var expedition_state : genshin.models.zzz.chronicle.notes.ExpeditionState | str
var level : int
var model_config : pydantic.config.ConfigDict
var shelve_state : genshin.models.zzz.chronicle.notes.ShelveStoreState | str
var weekly_currency_max : int

Instance variables

prop reset_datetime : datetime.datetime
Expand source code
@property
def reset_datetime(self) -> datetime.datetime:
    """The datetime when the currency will be reset."""
    return datetime.datetime.now().astimezone() + self.currency_next_refresh_ts

The datetime when the currency will be reset.